mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-04 19:02:28 +00:00
core: implement Neo.Storage.Find interop
This commit is contained in:
parent
7b5c47e7f5
commit
48cf4f4a84
4 changed files with 76 additions and 5 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
"github.com/CityOfZion/neo-go/pkg/core/state"
|
||||
"github.com/CityOfZion/neo-go/pkg/core/transaction"
|
||||
|
@ -429,7 +430,6 @@ func (ic *interopContext) accountIsStandard(v *vm.VM) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
/*
|
||||
// storageFind finds stored key-value pair.
|
||||
func (ic *interopContext) storageFind(v *vm.VM) error {
|
||||
stcInterface := v.Estack().Pop().Value()
|
||||
|
@ -446,16 +446,20 @@ func (ic *interopContext) storageFind(v *vm.VM) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
filteredMap := make(map[interface{}]vm.StackItem)
|
||||
for k, v := range siMap {
|
||||
if strings.HasPrefix(k, prefix) {
|
||||
_ = v
|
||||
panic("TODO")
|
||||
filteredMap[k] = vm.NewByteArrayItem(v.Value)
|
||||
}
|
||||
}
|
||||
|
||||
item := vm.NewMapIterator(filteredMap)
|
||||
v.Estack().PushVal(item)
|
||||
|
||||
return nil
|
||||
}
|
||||
*/
|
||||
|
||||
// createContractStateFromVM pops all contract state elements from the VM
|
||||
// evaluation stack, does a lot of checks and returns Contract if it
|
||||
// succeeds.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue