rpc: drop duplicating Invoke* structures

And use smartcontract.Parameter instead of vm.StackItem where
appropriate. Closes #689.
This commit is contained in:
Roman Khimov 2020-03-03 13:08:34 +03:00
parent 56e37ad6ba
commit 4c8d327353
7 changed files with 17 additions and 39 deletions

View file

@ -1,7 +1,7 @@
package result
import (
"github.com/CityOfZion/neo-go/pkg/vm"
"github.com/CityOfZion/neo-go/pkg/smartcontract"
)
// Invoke represents code invocation result and is used by several RPC calls
@ -10,5 +10,5 @@ type Invoke struct {
State string `json:"state"`
GasConsumed string `json:"gas_consumed"`
Script string `json:"script"`
Stack *vm.Stack
Stack []smartcontract.Parameter
}

View file

@ -4,19 +4,8 @@ import (
"encoding/json"
"github.com/CityOfZion/neo-go/pkg/rpc/response/result"
"github.com/CityOfZion/neo-go/pkg/smartcontract"
"github.com/CityOfZion/neo-go/pkg/vm"
)
// InvokeResult represents the outcome of a script that is
// executed by the NEO VM.
type InvokeResult struct {
State vm.State `json:"state"`
GasConsumed string `json:"gas_consumed"`
Script string `json:"script"`
Stack []smartcontract.Parameter
}
// Header is a generic JSON-RPC 2.0 response header (ID and JSON-RPC version).
type Header struct {
ID json.RawMessage `json:"id"`