本文整理匯總了Golang中github.com/FactomProject/factomd/common/interfaces.IState.LeaderFor方法的典型用法代碼示例。如果您正苦於以下問題:Golang IState.LeaderFor方法的具體用法?Golang IState.LeaderFor怎麽用?Golang IState.LeaderFor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/factomd/common/interfaces.IState
的用法示例。
在下文中一共展示了IState.LeaderFor方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Leader
// Returns true if this is a message for this server to execute as
// a leader.
func (m *CommitEntryMsg) Leader(state interfaces.IState) bool {
//TODO: implement properly
return state.LeaderFor(nil)
/*
switch state.GetNetworkNumber() {
case 0: // Main Network
panic("Not implemented yet")
case 1: // Test Network
panic("Not implemented yet")
case 2: // Local Network
panic("Not implemented yet")
default:
panic("Not implemented yet")
}*/
}
示例2: Leader
// Returns true if this is a message for this server to execute as
// a leader.
func (m *FactoidTransaction) Leader(state interfaces.IState) bool {
return state.LeaderFor(constants.FACTOID_CHAINID)
}
示例3: Leader
// Returns true if this is a message for this server to execute as
// a leader.
func (m *RevealEntryMsg) Leader(state interfaces.IState) bool {
return state.LeaderFor(m.Entry.GetHash().Bytes())
}
示例4: Leader
// Returns true if this is a message for this server to execute as
// a leader.
func (m *CommitChainMsg) Leader(state interfaces.IState) bool {
return state.LeaderFor(constants.EC_CHAINID)
}