neoneo-go/pkg/rpc/server/testdata/verification_contract.go

15 lines
459 B
Go
Raw Normal View History

package testdata
import (
"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 NTh9TnZTstvAePEYWDGLLxidBikJE24uTo (id-0 private key from testchain).
func Verify() bool {
tx := runtime.GetScriptContainer()
addr := util.FromAddress("NTh9TnZTstvAePEYWDGLLxidBikJE24uTo")
2021-03-09 10:18:34 +00:00
return util.Equals(string(tx.Sender), string(addr))
}