mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-04 19:19:44 +00:00
5b05081525
And update default mainnet/testnet settings. Follow neo-project/neo#1888 and neo-project/neo-node#656.
25 lines
641 B
Go
25 lines
641 B
Go
package config
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestGetFreeGas(t *testing.T) {
|
|
fixed10 := util.Fixed8FromInt64(10)
|
|
fixed50 := util.Fixed8FromInt64(50)
|
|
p := ProtocolConfiguration{
|
|
FreeGasLimit: map[uint32]util.Fixed8{
|
|
0: fixed10,
|
|
6200000: fixed50,
|
|
},
|
|
}
|
|
require.Equal(t, fixed10, p.GetFreeGas(0))
|
|
require.Equal(t, fixed10, p.GetFreeGas(1000))
|
|
require.Equal(t, fixed10, p.GetFreeGas(1000000))
|
|
require.Equal(t, fixed10, p.GetFreeGas(6100000))
|
|
require.Equal(t, fixed50, p.GetFreeGas(6200000))
|
|
require.Equal(t, fixed50, p.GetFreeGas(7000000))
|
|
}
|