rpc: provide old transfers in getnep5transfers
Return performed transfers even if contract was migrated.
This commit is contained in:
parent
7cd1bca1e1
commit
f0d75afc48
6 changed files with 95 additions and 29 deletions
11
pkg/rpc/server/testdata/test_contract.go
vendored
11
pkg/rpc/server/testdata/test_contract.go
vendored
|
@ -1,6 +1,7 @@
|
|||
package testdata
|
||||
|
||||
import (
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/contract"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/engine"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/runtime"
|
||||
"github.com/nspcc-dev/neo-go/pkg/interop/storage"
|
||||
|
@ -76,6 +77,16 @@ func Main(operation string, args []interface{}) interface{} {
|
|||
storage.Put(ctx, h, amount)
|
||||
runtime.Notify("transfer", []byte{}, h, amount)
|
||||
return true
|
||||
case "migrate":
|
||||
script := args[0].([]byte)
|
||||
params := []byte{0x07, 0x10} // string + array
|
||||
description := args[1].(string)
|
||||
email := args[2].(string)
|
||||
author := args[3].(string)
|
||||
version := args[4].(string)
|
||||
name := args[5].(string)
|
||||
contract.Migrate(script, params, 0x05, 0x01, name, version, author, email, description)
|
||||
return true
|
||||
default:
|
||||
panic("invalid operation")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue