2021-12-07 09:54:21 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/nspcc-dev/neo-go/pkg/encoding/fixedn"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestFees(t *testing.T) {
|
|
|
|
var v fees
|
|
|
|
|
|
|
|
const method = "some method"
|
|
|
|
|
|
|
|
var (
|
|
|
|
fee fixedn.Fixed8
|
|
|
|
def = fixedn.Fixed8(13)
|
|
|
|
)
|
|
|
|
|
2022-06-29 13:02:07 +00:00
|
|
|
v.defaultFee = def
|
2021-12-07 09:54:21 +00:00
|
|
|
|
|
|
|
fee = v.feeForMethod(method)
|
|
|
|
require.True(t, fee.Equal(def))
|
|
|
|
|
|
|
|
const customFee = fixedn.Fixed8(10)
|
|
|
|
|
|
|
|
v.setFeeForMethod(method, customFee)
|
|
|
|
|
|
|
|
fee = v.feeForMethod(method)
|
|
|
|
|
|
|
|
require.Equal(t, customFee, fee)
|
|
|
|
}
|