aboutsummaryrefslogtreecommitdiffstats
path: root/dex/downloader
diff options
context:
space:
mode:
authorWei-Ning Huang <w@byzantine-lab.io>2019-07-25 20:41:46 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-09-17 16:57:31 +0800
commit174f6bfcdf4e2c7fea3a071653908b477ad9a3b3 (patch)
tree7990bd656bd9cc7ef3014534ad2fee5163da3790 /dex/downloader
parenta9a85fa746c727063015d6e70881426ce8b3a3fb (diff)
downloadgo-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar.gz
go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar.zst
go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.zip
core: add GovUtil to unify governance state related access
Add GovUtil so we could use the same logic in everywhere that requires access to governance state, such as configuration and CRS.
Diffstat (limited to 'dex/downloader')
-rw-r--r--dex/downloader/testchain_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/dex/downloader/testchain_test.go b/dex/downloader/testchain_test.go
index 9595dc212..32e6110c4 100644
--- a/dex/downloader/testchain_test.go
+++ b/dex/downloader/testchain_test.go
@@ -332,15 +332,15 @@ func (g *govStateFetcher) SnapshotRound(round uint64, root common.Hash) {
g.rootByRound[round] = root
}
-func (g *govStateFetcher) GetStateForConfigAtRound(round uint64) *vm.GovernanceState {
+func (g *govStateFetcher) GetConfigState(round uint64) (*vm.GovernanceState, error) {
if root, ok := g.rootByRound[round]; ok {
s, err := state.New(root, g.db)
if err != nil {
- panic(err)
+ return nil, err
}
- return &vm.GovernanceState{s}
+ return &vm.GovernanceState{s}, nil
}
- return nil
+ return nil, nil
}
func (g *govStateFetcher) DKGSetNodeKeyAddresses(round uint64) (map[common.Address]struct{}, error) {