diff options
author | Wei-Ning Huang <w@byzantine-lab.io> | 2019-07-25 20:41:46 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-09-17 16:57:31 +0800 |
commit | 174f6bfcdf4e2c7fea3a071653908b477ad9a3b3 (patch) | |
tree | 7990bd656bd9cc7ef3014534ad2fee5163da3790 /dex/api_backend.go | |
parent | a9a85fa746c727063015d6e70881426ce8b3a3fb (diff) | |
download | go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar.gz go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar.bz2 go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar.lz go-tangerine-174f6bfcdf4e2c7fea3a071653908b477ad9a3b3.tar.xz 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/api_backend.go')
-rw-r--r-- | dex/api_backend.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/dex/api_backend.go b/dex/api_backend.go index 39c34550b..31b5a650e 100644 --- a/dex/api_backend.go +++ b/dex/api_backend.go @@ -187,7 +187,11 @@ func (b *DexAPIBackend) ProtocolVersion() int { } func (b *DexAPIBackend) SuggestPrice(ctx context.Context) (*big.Int, error) { - return b.dex.governance.MinGasPrice(b.dex.blockchain.CurrentBlock().Round()), nil + gs, err := b.dex.governance.GetConfigState(b.dex.blockchain.CurrentBlock().Round()) + if err != nil { + return nil, err + } + return gs.MinGasPrice(), nil } func (b *DexAPIBackend) ChainDb() ethdb.Database { |