Documentation ¶
Overview ¶
Package state_fsm is a generated GoMock package.
Index ¶
- Variables
- func HaltTransition(info BaseInfo) (FSM, Async, error)
- func MinedBlockNgTransition(info BaseInfo, block *proto.Block, limits proto.MiningLimits, ...) (FSM, Async, error)
- func NewFsm(services services.Services, outdatePeriod proto.Timestamp) (FSM, Async, error)
- func NewPersistTransition(info BaseInfo) (FSM, Async, error)
- func NewSyncFsm(baseInfo BaseInfo, conf conf, internal sync_internal.Internal) (FSM, Async, error)
- type Actions
- type ActionsImpl
- type Async
- type BaseInfo
- type BlocksApplier
- type Default
- type DefaultImpl
- type FSM
- type FromBaseInfo
- type HaltFSM
- func (a HaltFSM) Block(peer peer.Peer, block *proto.Block) (FSM, Async, error)
- func (a HaltFSM) BlockIDs(peer peer.Peer, sigs []proto.BlockID) (FSM, Async, error)
- func (a HaltFSM) Errorf(err error) error
- func (a HaltFSM) Halt() (FSM, Async, error)
- func (a HaltFSM) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (FSM, Async, error)
- func (a HaltFSM) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (FSM, Async, error)
- func (a HaltFSM) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (FSM, Async, error)
- func (a HaltFSM) NewPeer(p peer.Peer) (FSM, Async, error)
- func (a HaltFSM) PeerError(peer.Peer, error) (FSM, Async, error)
- func (a HaltFSM) Score(p peer.Peer, score *proto.Score) (FSM, Async, error)
- func (a HaltFSM) String() string
- func (a HaltFSM) Task(task tasks.AsyncTask) (FSM, Async, error)
- func (a HaltFSM) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error)
- type IdleFsm
- func (a *IdleFsm) Block(_ peer.Peer, _ *proto.Block) (FSM, Async, error)
- func (a *IdleFsm) BlockIDs(_ peer.Peer, _ []proto.BlockID) (FSM, Async, error)
- func (a *IdleFsm) Errorf(err error) error
- func (a *IdleFsm) Halt() (FSM, Async, error)
- func (a *IdleFsm) MicroBlock(_ peer.Peer, _ *proto.MicroBlock) (FSM, Async, error)
- func (a *IdleFsm) MicroBlockInv(_ peer.Peer, _ *proto.MicroBlockInv) (FSM, Async, error)
- func (a *IdleFsm) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (FSM, Async, error)
- func (a *IdleFsm) NewPeer(p peer.Peer) (FSM, Async, error)
- func (a *IdleFsm) PeerError(p peer.Peer, e error) (FSM, Async, error)
- func (a *IdleFsm) Score(p peer.Peer, score *proto.Score) (FSM, Async, error)
- func (a *IdleFsm) String() string
- func (a *IdleFsm) Task(task tasks.AsyncTask) (FSM, Async, error)
- func (a *IdleFsm) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error)
- type InvRequester
- type MockDefault
- type MockDefaultMockRecorder
- type MockTime
- type NGFsm
- func (a *NGFsm) Block(peer peer.Peer, block *proto.Block) (FSM, Async, error)
- func (a *NGFsm) BlockIDs(_ peer.Peer, _ []proto.BlockID) (FSM, Async, error)
- func (a *NGFsm) Errorf(err error) error
- func (a *NGFsm) Halt() (FSM, Async, error)
- func (a *NGFsm) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (FSM, Async, error)
- func (a *NGFsm) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (FSM, Async, error)
- func (a *NGFsm) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (FSM, Async, error)
- func (a *NGFsm) NewPeer(p peer.Peer) (FSM, Async, error)
- func (a *NGFsm) PeerError(p peer.Peer, e error) (FSM, Async, error)
- func (a *NGFsm) Score(p peer.Peer, score *proto.Score) (FSM, Async, error)
- func (a *NGFsm) String() string
- func (a *NGFsm) Task(task AsyncTask) (FSM, Async, error)
- func (a *NGFsm) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error)
- type PersistFsm
- func (a *PersistFsm) Block(p peer.Peer, block *proto.Block) (FSM, Async, error)
- func (a *PersistFsm) BlockIDs(peer peer.Peer, ids []proto.BlockID) (FSM, Async, error)
- func (a *PersistFsm) Errorf(err error) error
- func (a *PersistFsm) Halt() (FSM, Async, error)
- func (a *PersistFsm) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (FSM, Async, error)
- func (a *PersistFsm) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (FSM, Async, error)
- func (a *PersistFsm) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (FSM, Async, error)
- func (a *PersistFsm) NewPeer(p peer.Peer) (FSM, Async, error)
- func (a *PersistFsm) PeerError(p peer.Peer, e error) (FSM, Async, error)
- func (a *PersistFsm) Score(p peer.Peer, score *proto.Score) (FSM, Async, error)
- func (a *PersistFsm) String() string
- func (a *PersistFsm) Task(t tasks.AsyncTask) (FSM, Async, error)
- func (a *PersistFsm) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error)
- type SyncFsm
- func (a *SyncFsm) Block(p peer.Peer, block *proto.Block) (FSM, Async, error)
- func (a *SyncFsm) BlockIDs(peer peer.Peer, signatures []proto.BlockID) (FSM, Async, error)
- func (a *SyncFsm) Errorf(err error) error
- func (a *SyncFsm) Halt() (FSM, Async, error)
- func (a *SyncFsm) MicroBlock(_ peer.Peer, _ *proto.MicroBlock) (FSM, Async, error)
- func (a *SyncFsm) MicroBlockInv(_ peer.Peer, _ *proto.MicroBlockInv) (FSM, Async, error)
- func (a *SyncFsm) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, ...) (FSM, Async, error)
- func (a *SyncFsm) NewPeer(p peer.Peer) (FSM, Async, error)
- func (a *SyncFsm) PeerError(p peer.Peer, _ error) (FSM, Async, error)
- func (a *SyncFsm) Score(p peer.Peer, score *proto.Score) (FSM, Async, error)
- func (a *SyncFsm) String() string
- func (a *SyncFsm) Task(task tasks.AsyncTask) (FSM, Async, error)
- func (a *SyncFsm) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error)
Constants ¶
This section is empty.
Variables ¶
var TimeoutErr = proto.NewInfoMsg(errors.New("timeout"))
Functions ¶
func MinedBlockNgTransition ¶
func NewSyncFsm ¶
Types ¶
type ActionsImpl ¶
type ActionsImpl struct {
// contains filtered or unexported fields
}
func (*ActionsImpl) SendBlock ¶
func (a *ActionsImpl) SendBlock(block *proto.Block)
func (*ActionsImpl) SendScore ¶
func (a *ActionsImpl) SendScore(s currentScorer)
type BaseInfo ¶
type BaseInfo struct { // scheduler types.Scheduler MicroBlockCache services.MicroBlockCache MicroBlockInvCache services.MicroBlockInvCache // contains filtered or unexported fields }
func (*BaseInfo) BroadcastTransaction ¶
func (a *BaseInfo) BroadcastTransaction(t proto.Transaction, receivedFrom peer.Peer)
type BlocksApplier ¶
type FSM ¶
type FSM interface { NewPeer(p peer.Peer) (FSM, Async, error) PeerError(p peer.Peer, e error) (FSM, Async, error) Score(p peer.Peer, score *proto.Score) (FSM, Async, error) Block(p peer.Peer, block *proto.Block) (FSM, Async, error) MinedBlock(block *proto.Block, limits proto.MiningLimits, keyPair proto.KeyPair, vrf []byte) (FSM, Async, error) // BlockIDs receives signatures that was requested by GetSignatures BlockIDs(peer.Peer, []proto.BlockID) (FSM, Async, error) Task(task AsyncTask) (FSM, Async, error) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (FSM, Async, error) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (FSM, Async, error) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error) Halt() (FSM, Async, error) String() string Errorf(err error) error }
type FromBaseInfo ¶
type HaltFSM ¶
type HaltFSM struct { }
func (HaltFSM) MicroBlock ¶
func (HaltFSM) MicroBlockInv ¶
func (HaltFSM) MinedBlock ¶
func (HaltFSM) Transaction ¶
type IdleFsm ¶
type IdleFsm struct {
// contains filtered or unexported fields
}
func NewIdleFsm ¶
func (*IdleFsm) MicroBlock ¶
func (*IdleFsm) MicroBlockInv ¶
func (*IdleFsm) MinedBlock ¶
func (*IdleFsm) Transaction ¶
type InvRequester ¶
type InvRequester interface {
Request(p types.MessageSender, id []byte)
}
type MockDefault ¶
type MockDefault struct {
// contains filtered or unexported fields
}
MockDefault is a mock of Default interface.
func NewMockDefault ¶
func NewMockDefault(ctrl *gomock.Controller) *MockDefault
NewMockDefault creates a new mock instance.
func (*MockDefault) EXPECT ¶
func (m *MockDefault) EXPECT() *MockDefaultMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDefaultMockRecorder ¶
type MockDefaultMockRecorder struct {
// contains filtered or unexported fields
}
MockDefaultMockRecorder is the mock recorder for MockDefault.
func (*MockDefaultMockRecorder) NewPeer ¶
func (mr *MockDefaultMockRecorder) NewPeer(fsm, p, info interface{}) *gomock.Call
NewPeer indicates an expected call of NewPeer.
func (*MockDefaultMockRecorder) Noop ¶
func (mr *MockDefaultMockRecorder) Noop(arg0 interface{}) *gomock.Call
Noop indicates an expected call of Noop.
func (*MockDefaultMockRecorder) PeerError ¶
func (mr *MockDefaultMockRecorder) PeerError(fsm, p, baseInfo, arg3 interface{}) *gomock.Call
PeerError indicates an expected call of PeerError.
type MockTime ¶ added in v0.10.0
type MockTime struct { // NowFunc mocks the Now method. NowFunc func() time.Time // contains filtered or unexported fields }
MockTime is a mock implementation of types.Time.
func TestSomethingThatUsesTime(t *testing.T) { // make and configure a mocked types.Time mockedTime := &MockTime{ NowFunc: func() time.Time { panic("mock out the Now method") }, } // use mockedTime in code that requires types.Time // and then make assertions. }
type NGFsm ¶
type NGFsm struct {
// contains filtered or unexported fields
}
func NewNGFsm12 ¶
func (*NGFsm) MicroBlock ¶
MicroBlock handles new microblock message.
func (*NGFsm) MicroBlockInv ¶
func (*NGFsm) MinedBlock ¶
func (*NGFsm) Transaction ¶
type PersistFsm ¶
type PersistFsm struct {
BaseInfo
}
Save transactions by address from temporary file into storage. Only read operations permitted.
func (*PersistFsm) Errorf ¶ added in v0.10.0
func (a *PersistFsm) Errorf(err error) error
func (*PersistFsm) MicroBlock ¶
func (a *PersistFsm) MicroBlock(p peer.Peer, micro *proto.MicroBlock) (FSM, Async, error)
func (*PersistFsm) MicroBlockInv ¶
func (a *PersistFsm) MicroBlockInv(p peer.Peer, inv *proto.MicroBlockInv) (FSM, Async, error)
func (*PersistFsm) MinedBlock ¶
func (*PersistFsm) String ¶ added in v0.10.0
func (a *PersistFsm) String() string
func (*PersistFsm) Transaction ¶
func (a *PersistFsm) Transaction(p peer.Peer, t proto.Transaction) (FSM, Async, error)
type SyncFsm ¶
type SyncFsm struct {
// contains filtered or unexported fields
}
func (*SyncFsm) MicroBlock ¶
MicroBlock ignores new microblocks while syncing.
func (*SyncFsm) MicroBlockInv ¶
MicroBlockInv ignores microblock requests while syncing.