GetRootChainLotteryWinner() gets the pseudorandomly selected delegate to reward and their cut
(fsm *fsm.StateMachine, rootHeight uint64)
| 220 | |
| 221 | // GetRootChainLotteryWinner() gets the pseudorandomly selected delegate to reward and their cut |
| 222 | func (c *Controller) GetRootChainLotteryWinner(fsm *fsm.StateMachine, rootHeight uint64) (winner *lib.LotteryWinner, err lib.ErrorI) { |
| 223 | // get the root chain id from the state machine |
| 224 | rootChainId, err := fsm.LoadRootChainId(c.ChainHeight()) |
| 225 | // if an error occurred retrieving the id |
| 226 | if err != nil { |
| 227 | // exit with error |
| 228 | return nil, err |
| 229 | } |
| 230 | // execute the remote call |
| 231 | return c.RCManager.GetLotteryWinner(rootChainId, rootHeight, c.Config.ChainId) |
| 232 | } |
| 233 | |
| 234 | // IsValidDoubleSigner() checks if the double signer is valid at a certain double sign height |
| 235 | func (c *Controller) IsValidDoubleSigner(rootChainId, rootHeight uint64, address []byte) bool { |
no test coverage detected