rpc/client: allow to use contract accounts in AddNetworkFee
This commit is contained in:
parent
f6319f80e8
commit
9c7168e4e8
6 changed files with 129 additions and 33 deletions
15
pkg/rpc/server/testdata/verification_contract.go
vendored
Normal file
15
pkg/rpc/server/testdata/verification_contract.go
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
package testdata
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/convert"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/util"
|
||||
)
|
||||
|
||||
// Verify is a verification contract method.
|
||||
// It returns true iff it is signed by NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc (id-0 private key from testchain).
|
||||
func Verify() bool {
|
||||
tx := runtime.GetScriptContainer()
|
||||
addr := util.FromAddress("NbTiM6h8r99kpRtb428XcsUk1TzKed2gTc")
|
||||
return util.Equals(convert.ToByteArray(tx.Sender), convert.ToByteArray(addr))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue