aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/oracle_contracts_test.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-02-22 13:14:55 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:22 +0800
commit2354d4aa747616a8fd4fb9482ada8042fd362139 (patch)
tree46fe0953c0258591c2cd415c3760764ff613a5bb /core/vm/oracle_contracts_test.go
parent81193a683d6328b627ee0e5f0f3689b3473e29ea (diff)
downloadgo-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.tar
go-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.tar.gz
go-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.tar.bz2
go-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.tar.lz
go-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.tar.xz
go-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.tar.zst
go-tangerine-2354d4aa747616a8fd4fb9482ada8042fd362139.zip
core: Remove K, Phi and NumChains from Governance (#198)
* change default sync_core.sh * vendor: sync to latest core * core: Remove K, Phi and NumChain
Diffstat (limited to 'core/vm/oracle_contracts_test.go')
-rw-r--r--core/vm/oracle_contracts_test.go42
1 files changed, 6 insertions, 36 deletions
diff --git a/core/vm/oracle_contracts_test.go b/core/vm/oracle_contracts_test.go
index 654070c57..dd17dddea 100644
--- a/core/vm/oracle_contracts_test.go
+++ b/core/vm/oracle_contracts_test.go
@@ -648,14 +648,11 @@ func (g *OracleContractsTestSuite) TestUpdateConfiguration() {
new(big.Int).Mul(big.NewInt(1e18), big.NewInt(1e6)),
big.NewInt(1000),
big.NewInt(8000000),
- big.NewInt(6),
big.NewInt(250),
big.NewInt(2500),
- big.NewInt(0),
- big.NewInt(667000),
big.NewInt(4),
big.NewInt(4),
- big.NewInt(600000),
+ big.NewInt(600),
big.NewInt(900),
[]*big.Int{big.NewInt(1), big.NewInt(1), big.NewInt(1)})
g.Require().NoError(err)
@@ -720,15 +717,6 @@ func (g *OracleContractsTestSuite) TestConfigurationReading() {
g.Require().NoError(err)
g.Require().Equal(g.config.BlockGasLimit, value.Uint64())
- // NumChains.
- input, err = GovernanceABI.ABI.Pack("numChains")
- g.Require().NoError(err)
- res, err = g.call(GovernanceContractAddress, addr, input, big.NewInt(0))
- g.Require().NoError(err)
- err = GovernanceABI.ABI.Unpack(&value, "numChains", res)
- g.Require().NoError(err)
- g.Require().Equal(g.config.NumChains, uint32(value.Uint64()))
-
// LambdaBA.
input, err = GovernanceABI.ABI.Pack("lambdaBA")
g.Require().NoError(err)
@@ -747,24 +735,6 @@ func (g *OracleContractsTestSuite) TestConfigurationReading() {
g.Require().NoError(err)
g.Require().Equal(g.config.LambdaDKG, value.Uint64())
- // K.
- input, err = GovernanceABI.ABI.Pack("k")
- g.Require().NoError(err)
- res, err = g.call(GovernanceContractAddress, addr, input, big.NewInt(0))
- g.Require().NoError(err)
- err = GovernanceABI.ABI.Unpack(&value, "k", res)
- g.Require().NoError(err)
- g.Require().Equal(g.config.K, uint32(value.Uint64()))
-
- // PhiRatio.
- input, err = GovernanceABI.ABI.Pack("phiRatio")
- g.Require().NoError(err)
- res, err = g.call(GovernanceContractAddress, addr, input, big.NewInt(0))
- g.Require().NoError(err)
- err = GovernanceABI.ABI.Unpack(&value, "phiRatio", res)
- g.Require().NoError(err)
- g.Require().Equal(g.config.PhiRatio, float32(value.Uint64())/decimalMultiplier)
-
// NotarySetSize.
input, err = GovernanceABI.ABI.Pack("notarySetSize")
g.Require().NoError(err)
@@ -783,14 +753,14 @@ func (g *OracleContractsTestSuite) TestConfigurationReading() {
g.Require().NoError(err)
g.Require().Equal(g.config.DKGSetSize, uint32(value.Uint64()))
- // RoundInterval.
- input, err = GovernanceABI.ABI.Pack("roundInterval")
+ // RoundLength.
+ input, err = GovernanceABI.ABI.Pack("roundLength")
g.Require().NoError(err)
res, err = g.call(GovernanceContractAddress, addr, input, big.NewInt(0))
g.Require().NoError(err)
- err = GovernanceABI.ABI.Unpack(&value, "roundInterval", res)
+ err = GovernanceABI.ABI.Unpack(&value, "roundLength", res)
g.Require().NoError(err)
- g.Require().Equal(g.config.RoundInterval, value.Uint64())
+ g.Require().Equal(g.config.RoundLength, value.Uint64())
// MinBlockInterval.
input, err = GovernanceABI.ABI.Pack("minBlockInterval")
@@ -1187,7 +1157,7 @@ func (g *OracleContractsTestSuite) TestResetDKG() {
}
// Fill data for previous rounds.
- roundHeight := int64(g.config.RoundInterval / g.config.MinBlockInterval)
+ roundHeight := int64(g.config.RoundLength)
round := 3
for i := 0; i <= round; i++ {
// Prepare CRS.