frostfs-contract/tests/balance_test.go

30 lines
841 B
Go
Raw Normal View History

package tests
import (
"path"
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-contract/covertest"
"github.com/nspcc-dev/neo-go/pkg/neotest"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
)
const balancePath = "../balance"
func deployBalanceContract(t *testing.T, e *neotest.Executor, addrNetmap, addrContainer util.Uint160) util.Uint160 {
c := covertest.CompileFile(t, e.CommitteeHash, balancePath, path.Join(balancePath, "config.yml"))
args := make([]interface{}, 3)
args[0] = false
args[1] = addrNetmap
args[2] = addrContainer
e.DeployContract(t, c.Contract, args)
return c.Contract.Hash
}
func balanceMint(t *testing.T, c *covertest.ContractInvoker, acc neotest.Signer, amount int64, details []byte) {
c.Invoke(t, stackitem.Null{}, "mint", acc.ScriptHash(), amount, details)
}