本文整理匯總了Golang中github.com/FactomProject/factomd/state.State.UpdateState方法的典型用法代碼示例。如果您正苦於以下問題:Golang State.UpdateState方法的具體用法?Golang State.UpdateState怎麽用?Golang State.UpdateState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/FactomProject/factomd/state.State
的用法示例。
在下文中一共展示了State.UpdateState方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: CreateAndPopulateTestState
func CreateAndPopulateTestState() *state.State {
s := new(state.State)
s.DB = CreateAndPopulateTestDatabaseOverlay()
s.LoadConfig("", "")
s.Init()
s.NetworkNumber = constants.NETWORK_MAIN
/*err := s.RecalculateBalances()
if err != nil {
panic(err)
}*/
s.SetFactoshisPerEC(1)
state.LoadDatabase(s)
s.UpdateState()
go s.ValidatorLoop()
time.Sleep(30 * time.Millisecond)
return s
}
示例2: CreateAndPopulateTestStateForFER
func CreateAndPopulateTestStateForFER(testEntries []FEREntryWithHeight, desiredHeight int) *state.State {
s := new(state.State)
s.DB = CreateAndPopulateTestDatabaseOverlayForFER(testEntries, desiredHeight)
s.LoadConfig("", "")
s.Init()
/*err := s.RecalculateBalances()
if err != nil {
panic(err)
}*/
s.SetFactoshisPerEC(1)
state.LoadDatabase(s)
s.FERChainId = "111111118d918a8be684e0dac725493a75862ef96d2d3f43f84b26969329bf03"
s.UpdateState()
go s.ValidatorLoop()
time.Sleep(20 * time.Millisecond)
return s
}