Merge pull request #974 from nspcc-dev/fix/state

vm: allow to convert Map item to bool

Fixes
2020-05-21T17:45:51.808+0300 WARN contract invocation failed {"tx": "71c43cc32ae5336622d7105d1c96387c8cca6c948beac29edfef46712ba5ffeb", "block": 3960417, "error": "error encountered at instruction 14802 (JMPIFNOT): can't convert to bool: Map"}
This commit is contained in:
Roman Khimov 2020-05-21 17:59:19 +03:00 committed by GitHub
commit 4fda492873
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -96,7 +96,7 @@ func (e *Element) TryBool() (bool, error) {
return t.value.Int64() != 0, nil
case *BoolItem:
return t.value, nil
case *ArrayItem, *StructItem:
case *ArrayItem, *StructItem, *MapItem:
return true, nil
case *ByteArrayItem:
for _, b := range t.value {