forked from TrueCloudLab/frostfs-node
feb0a65efb
In notary disabled environment, approval of container creation with nice name attribute takes much more additional GAS than other operations (due to NNS invocation). Morph library changes: * add the ability to specify per-op fees using `StaticClient` options; * add the ability to customize fee for `Put` operation with named container in container morph client. Inner Ring changes: * add `fee.named_container_register` config value which specifies additional GAS fee for the approvals of the named container registrations; * pass the config value to `WithCustomFeeForNamedPut` option of container morph client. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
32 lines
489 B
Go
32 lines
489 B
Go
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)
|
|
)
|
|
|
|
v.setDefault(def)
|
|
|
|
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)
|
|
}
|