Skip to content

Commit

Permalink
nodes setup mock updated
Browse files Browse the repository at this point in the history
  • Loading branch information
axenteoctavian committed Nov 28, 2024
1 parent 7a8922f commit 368e17a
Showing 1 changed file with 68 additions and 30 deletions.
98 changes: 68 additions & 30 deletions update/mock/nodesSetupHandlerStub.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,28 @@ import (

// GenesisNodesSetupHandlerStub -
type GenesisNodesSetupHandlerStub struct {
InitialNodesInfoForShardCalled func(shardId uint32) ([]nodesCoordinator.GenesisNodeInfoHandler, []nodesCoordinator.GenesisNodeInfoHandler, error)
InitialNodesInfoCalled func() (map[uint32][]nodesCoordinator.GenesisNodeInfoHandler, map[uint32][]nodesCoordinator.GenesisNodeInfoHandler)
GetStartTimeCalled func() int64
GetRoundDurationCalled func() uint64
GetChainIdCalled func() string
GetMinTransactionVersionCalled func() uint32
GetShardConsensusGroupSizeCalled func() uint32
GetMetaConsensusGroupSizeCalled func() uint32
MinNumberOfShardNodesCalled func() uint32
MinNumberOfMetaNodesCalled func() uint32
GetHysteresisCalled func() float32
GetAdaptivityCalled func() bool
NumberOfShardsCalled func() uint32
MinNumberOfNodesCalled func() uint32
InitialNodesInfoForShardCalled func(shardId uint32) ([]nodesCoordinator.GenesisNodeInfoHandler, []nodesCoordinator.GenesisNodeInfoHandler, error)
InitialNodesInfoCalled func() (map[uint32][]nodesCoordinator.GenesisNodeInfoHandler, map[uint32][]nodesCoordinator.GenesisNodeInfoHandler)
GetStartTimeCalled func() int64
GetRoundDurationCalled func() uint64
GetChainIdCalled func() string
GetMinTransactionVersionCalled func() uint32
GetShardConsensusGroupSizeCalled func() uint32
GetMetaConsensusGroupSizeCalled func() uint32
MinNumberOfShardNodesCalled func() uint32
MinNumberOfMetaNodesCalled func() uint32
GetHysteresisCalled func() float32
GetAdaptivityCalled func() bool
NumberOfShardsCalled func() uint32
MinNumberOfNodesCalled func() uint32
AllInitialNodesCalled func() []nodesCoordinator.GenesisNodeInfoHandler
InitialNodesPubKeysCalled func() map[uint32][]string
GetShardIDForPubKeyCalled func(pubkey []byte) (uint32, error)
InitialEligibleNodesPubKeysForShardCalled func(shardId uint32) ([]string, error)
SetStartTimeCalled func(startTime int64)
MinNumberOfNodesWithHysteresisCalled func() uint32
MinShardHysteresisNodesCalled func() uint32
MinMetaHysteresisNodesCalled func() uint32
}

// InitialNodesInfoForShard -
Expand Down Expand Up @@ -150,44 +158,74 @@ func (g *GenesisNodesSetupHandlerStub) MinNumberOfNodes() uint32 {
return 1
}

// AllInitialNodes -
func (g *GenesisNodesSetupHandlerStub) AllInitialNodes() []nodesCoordinator.GenesisNodeInfoHandler {
//TODO implement me
panic("implement me")
if g.AllInitialNodesCalled != nil {
return g.AllInitialNodesCalled()
}

return nil
}

// InitialNodesPubKeys -
func (g *GenesisNodesSetupHandlerStub) InitialNodesPubKeys() map[uint32][]string {
//TODO implement me
panic("implement me")
if g.InitialNodesPubKeysCalled != nil {
return g.InitialNodesPubKeysCalled()
}

return nil
}

// GetShardIDForPubKey -
func (g *GenesisNodesSetupHandlerStub) GetShardIDForPubKey(pubkey []byte) (uint32, error) {
//TODO implement me
panic("implement me")
if g.GetShardIDForPubKeyCalled != nil {
return g.GetShardIDForPubKeyCalled(pubkey)
}

return 0, nil
}

// InitialEligibleNodesPubKeysForShard -
func (g *GenesisNodesSetupHandlerStub) InitialEligibleNodesPubKeysForShard(shardId uint32) ([]string, error) {
//TODO implement me
panic("implement me")
if g.InitialEligibleNodesPubKeysForShardCalled != nil {
return g.InitialEligibleNodesPubKeysForShardCalled(shardId)
}

return nil, nil
}

// SetStartTime -
func (g *GenesisNodesSetupHandlerStub) SetStartTime(startTime int64) {
//TODO implement me
panic("implement me")
if g.SetStartTimeCalled != nil {
g.SetStartTimeCalled(startTime)
}
}

// MinNumberOfNodesWithHysteresis -
func (g *GenesisNodesSetupHandlerStub) MinNumberOfNodesWithHysteresis() uint32 {
//TODO implement me
panic("implement me")
if g.MinNumberOfNodesWithHysteresisCalled != nil {
return g.MinNumberOfNodesWithHysteresisCalled()
}

return 0
}

// MinShardHysteresisNodes -
func (g *GenesisNodesSetupHandlerStub) MinShardHysteresisNodes() uint32 {
//TODO implement me
panic("implement me")
if g.MinShardHysteresisNodesCalled != nil {
return g.MinShardHysteresisNodesCalled()
}

return 0
}

// MinMetaHysteresisNodes -
func (g *GenesisNodesSetupHandlerStub) MinMetaHysteresisNodes() uint32 {
//TODO implement me
panic("implement me")
if g.MinMetaHysteresisNodesCalled != nil {
return g.MinMetaHysteresisNodesCalled()
}

return 0
}

// IsInterfaceNil -
Expand Down

0 comments on commit 368e17a

Please sign in to comment.