mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 13:41:47 +00:00
c2b3ee3d8e
This allows to reuse it across different packages. testchain can't be used because of circular dependencies. Init() is not changed except for filepath.Join() use instead of direct string appends which is a better approach anyway. rootpath is required because current directory will change from package to package.
14 lines
457 B
Go
14 lines
457 B
Go
package verify
|
|
|
|
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 Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn (id-0 private key from testchain).
|
|
func Verify() bool {
|
|
tx := runtime.GetScriptContainer()
|
|
addr := util.FromAddress("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
|
|
return util.Equals(string(tx.Sender), string(addr))
|
|
}
|