interop: drop deprecated util.FromAddress

It still was used in a number of places, surprisingly.
This commit is contained in:
Roman Khimov 2023-03-18 10:44:12 +03:00
parent 7306beca4d
commit 4671fbb3be
15 changed files with 42 additions and 113 deletions

View file

@ -1,6 +1,7 @@
package verify
import (
"github.com/nspcc-dev/neo-go/pkg/interop/lib/address"
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
"github.com/nspcc-dev/neo-go/pkg/interop/util"
)
@ -9,6 +10,6 @@ import (
// 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")
addr := address.ToHash160("Nhfg3TbpwogLvDGVvAvqyThbsHgoSUKwtn")
return util.Equals(string(tx.Sender), string(addr))
}