interop/crypto: allow ECDsaVerify to verify ScriptContainer
When verifying transaction or block, verification script can be a simple PUSHNULL + SYSCALL, which means that script-encontaining entity should be verified.
This commit is contained in:
parent
8f08065a8e
commit
a92872931c
3 changed files with 13 additions and 1 deletions
|
@ -49,11 +49,13 @@ func ECDSACheckMultisig(ic *interop.Context, v *vm.VM) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func getMessage(_ *interop.Context, item vm.StackItem) []byte {
|
||||
func getMessage(ic *interop.Context, item vm.StackItem) []byte {
|
||||
var msg []byte
|
||||
switch val := item.(type) {
|
||||
case *vm.InteropItem:
|
||||
msg = val.Value().(crypto.Verifiable).GetSignedPart()
|
||||
case vm.NullItem:
|
||||
msg = ic.Container.GetSignedPart()
|
||||
default:
|
||||
var err error
|
||||
if msg, err = val.TryBytes(); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue