2021-10-06 11:59:08 +00:00
|
|
|
package tests
|
|
|
|
|
|
|
|
import (
|
2021-10-26 11:28:14 +00:00
|
|
|
"path"
|
2021-10-06 11:59:08 +00:00
|
|
|
"testing"
|
|
|
|
|
2021-10-26 11:28:14 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/neotest"
|
2021-10-06 11:59:08 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/util"
|
2021-10-26 11:28:14 +00:00
|
|
|
"github.com/nspcc-dev/neo-go/pkg/vm/stackitem"
|
2021-10-06 11:59:08 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
const balancePath = "../balance"
|
|
|
|
|
2021-10-26 11:28:14 +00:00
|
|
|
func deployBalanceContract(t *testing.T, e *neotest.Executor, addrNetmap, addrContainer util.Uint160) util.Uint160 {
|
|
|
|
c := neotest.CompileFile(t, e.CommitteeHash, balancePath, path.Join(balancePath, "config.yml"))
|
|
|
|
|
2023-11-07 12:18:48 +00:00
|
|
|
args := make([]any, 3)
|
2023-11-07 11:55:02 +00:00
|
|
|
args[0] = addrNetmap
|
|
|
|
args[1] = addrContainer
|
2021-10-26 11:28:14 +00:00
|
|
|
|
|
|
|
e.DeployContract(t, c, args)
|
|
|
|
return c.Hash
|
2021-10-06 11:59:08 +00:00
|
|
|
}
|
2021-10-18 11:12:26 +00:00
|
|
|
|
2021-10-26 11:28:14 +00:00
|
|
|
func balanceMint(t *testing.T, c *neotest.ContractInvoker, acc neotest.Signer, amount int64, details []byte) {
|
|
|
|
c.Invoke(t, stackitem.Null{}, "mint", acc.ScriptHash(), amount, details)
|
2021-10-18 11:12:26 +00:00
|
|
|
}
|