Documentation ¶
Index ¶
- type FileStateMgr
- func (fsm *FileStateMgr) GetLocalState(pubKey string) (KeygenLocalState, error)
- func (fsm *FileStateMgr) RetrieveP2PAddresses() (p2p.AddrList, error)
- func (fsm *FileStateMgr) SaveAddressBook(address map[peer.ID]p2p.AddrList) error
- func (fsm *FileStateMgr) SaveLocalState(state KeygenLocalState) error
- type KeygenLocalState
- type LocalStateManager
- type MockLocalStateManager
- func (s *MockLocalStateManager) GetLocalState(pubKey string) (KeygenLocalState, error)
- func (s *MockLocalStateManager) RetrieveP2PAddresses() (p2p.AddrList, error)
- func (s *MockLocalStateManager) SaveAddressBook(address map[peer.ID]p2p.AddrList) error
- func (s *MockLocalStateManager) SaveLocalState(state KeygenLocalState) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileStateMgr ¶
type FileStateMgr struct {
// contains filtered or unexported fields
}
FileStateMgr save the local state to file
func NewFileStateMgr ¶
func NewFileStateMgr(folder string) (*FileStateMgr, error)
NewFileStateMgr create a new instance of the FileStateMgr which implements LocalStateManager
func (*FileStateMgr) GetLocalState ¶
func (fsm *FileStateMgr) GetLocalState(pubKey string) (KeygenLocalState, error)
GetLocalState read the local state from file system
func (*FileStateMgr) RetrieveP2PAddresses ¶
func (fsm *FileStateMgr) RetrieveP2PAddresses() (p2p.AddrList, error)
func (*FileStateMgr) SaveAddressBook ¶
func (*FileStateMgr) SaveLocalState ¶
func (fsm *FileStateMgr) SaveLocalState(state KeygenLocalState) error
SaveLocalState save the local state to file
type KeygenLocalState ¶
type KeygenLocalState struct { PubKey string `json:"pub_key"` LocalData keygen.LocalPartySaveData `json:"local_data"` ParticipantKeys []string `json:"participant_keys"` // the paticipant of last key gen LocalPartyKey string `json:"local_party_key"` }
KeygenLocalState is a structure used to represent the data we saved locally for different keygen
type LocalStateManager ¶
type LocalStateManager interface { SaveLocalState(state KeygenLocalState) error GetLocalState(pubKey string) (KeygenLocalState, error) SaveAddressBook(addressBook map[peer.ID]p2p.AddrList) error RetrieveP2PAddresses() (p2p.AddrList, error) }
LocalStateManager provide necessary methods to manage the local state, save it , and read it back LocalStateManager doesn't have any opinion in regards to where it should be persistent to
type MockLocalStateManager ¶
type MockLocalStateManager struct { }
MockLocalStateManager is a mock use for test purpose
func (*MockLocalStateManager) GetLocalState ¶
func (s *MockLocalStateManager) GetLocalState(pubKey string) (KeygenLocalState, error)
func (*MockLocalStateManager) RetrieveP2PAddresses ¶
func (s *MockLocalStateManager) RetrieveP2PAddresses() (p2p.AddrList, error)
func (*MockLocalStateManager) SaveAddressBook ¶
func (*MockLocalStateManager) SaveLocalState ¶
func (s *MockLocalStateManager) SaveLocalState(state KeygenLocalState) error
Click to show internal directories.
Click to hide internal directories.