frostfs-contract/tests/balance_test.go
Ekaterina Lebedeva 700d091061 Add covertest and change tests
Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
2023-08-15 16:27:26 +03:00

29 lines
841 B
Go

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)
}