Revert "[#198] test: Adopt neotest
changes"
This reverts commit 17907f9457
.
This commit is contained in:
parent
24d24b9db7
commit
8418183498
1 changed files with 7 additions and 13 deletions
|
@ -18,6 +18,11 @@ import (
|
|||
|
||||
const alphabetPath = "../alphabet"
|
||||
|
||||
// FIXME: delete after https://github.com/nspcc-dev/neo-go/issues/2297
|
||||
const singleValidatorWIF = "KxyjQ8eUa4FHt3Gvioyt1Wz29cTUrE4eTqX3yFSk1YFCsPL8uNsY"
|
||||
|
||||
var committeeAcc, _ = wallet.NewAccountFromWIF(singleValidatorWIF)
|
||||
|
||||
func deployAlphabetContract(t *testing.T, e *neotest.Executor, addrNetmap, addrProxy util.Uint160, name string, index, total int64) util.Uint160 {
|
||||
c := neotest.CompileFile(t, e.CommitteeHash, alphabetPath, path.Join(alphabetPath, "config.yml"))
|
||||
|
||||
|
@ -51,9 +56,7 @@ func newAlphabetInvoker(t *testing.T) (*neotest.Executor, *neotest.ContractInvok
|
|||
deployProxyContract(t, e, ctrNetmap.Hash)
|
||||
hash := deployAlphabetContract(t, e, ctrNetmap.Hash, ctrProxy.Hash, "Az", 0, 1)
|
||||
|
||||
alphabet := getAlphabetAcc(t, e)
|
||||
|
||||
setAlphabetRole(t, e, alphabet.PrivateKey().PublicKey().Bytes())
|
||||
setAlphabetRole(t, e, committeeAcc.PrivateKey().PublicKey().Bytes())
|
||||
|
||||
return e, e.CommitteeInvoker(hash)
|
||||
}
|
||||
|
@ -63,9 +66,7 @@ func TestEmit(t *testing.T) {
|
|||
|
||||
const method = "emit"
|
||||
|
||||
alphabet := getAlphabetAcc(t, c.Executor)
|
||||
|
||||
cCommittee := c.WithSigners(neotest.NewSingleSigner(alphabet))
|
||||
cCommittee := c.WithSigners(neotest.NewSingleSigner(committeeAcc))
|
||||
cCommittee.InvokeFail(t, "no gas to emit", method)
|
||||
|
||||
transferNeoToContract(t, c)
|
||||
|
@ -141,10 +142,3 @@ func setAlphabetRole(t *testing.T, e *neotest.Executor, new []byte) {
|
|||
// set committee as NeoFSAlphabet
|
||||
designInvoker.Invoke(t, stackitem.Null{}, "designateAsRole", int64(noderoles.NeoFSAlphabet), []interface{}{new})
|
||||
}
|
||||
|
||||
func getAlphabetAcc(t *testing.T, e *neotest.Executor) *wallet.Account {
|
||||
multi, ok := e.Committee.(neotest.MultiSigner)
|
||||
require.True(t, ok)
|
||||
|
||||
return multi.Single(0).Account()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue