mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-11 14:33:52 +00:00
add unittest for calculate sprint
This commit is contained in:
parent
17f403e404
commit
623d1ecf12
1 changed files with 12 additions and 0 deletions
|
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/eth"
|
"github.com/ethereum/go-ethereum/eth"
|
||||||
"github.com/ethereum/go-ethereum/log"
|
"github.com/ethereum/go-ethereum/log"
|
||||||
"github.com/ethereum/go-ethereum/p2p/enode"
|
"github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
|
"github.com/ethereum/go-ethereum/params"
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -150,3 +151,14 @@ func TestValidatorsBlockProduction(t *testing.T) {
|
||||||
assert.Equal(t, authorVal0, nodes[1].AccountManager().Accounts()[0])
|
assert.Equal(t, authorVal0, nodes[1].AccountManager().Accounts()[0])
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSprintLengths(t *testing.T) {
|
||||||
|
testBorConfig := params.TestChainConfig.Bor
|
||||||
|
testBorConfig.Sprint = map[string]uint64{
|
||||||
|
"0": 16,
|
||||||
|
"8": 4,
|
||||||
|
}
|
||||||
|
assert.Equal(t, testBorConfig.CalculateSprint(0), 16)
|
||||||
|
assert.Equal(t, testBorConfig.CalculateSprint(9), 4)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue