mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-09 03:13:13 +00:00
core: update claimable GAS calculation
This commit is contained in:
parent
1ff1cd797e
commit
7d90d79ae6
8 changed files with 191 additions and 69 deletions
|
@ -108,3 +108,20 @@ func TestNEO_Vote(t *testing.T) {
|
|||
require.NotEqual(t, candidates[0], pubs[i])
|
||||
}
|
||||
}
|
||||
|
||||
func TestNEO_CalculateBonus(t *testing.T) {
|
||||
bc := newTestChain(t)
|
||||
defer bc.Close()
|
||||
|
||||
neo := bc.contracts.NEO
|
||||
ic := bc.newInteropContext(trigger.System, bc.dao, nil, nil)
|
||||
t.Run("Invalid", func(t *testing.T) {
|
||||
_, err := neo.CalculateBonus(ic, new(big.Int).SetInt64(-1), 0, 1)
|
||||
require.Error(t, err)
|
||||
})
|
||||
t.Run("Zero", func(t *testing.T) {
|
||||
res, err := neo.CalculateBonus(ic, big.NewInt(0), 0, 100)
|
||||
require.NoError(t, err)
|
||||
require.EqualValues(t, 0, res.Int64())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue