Commit 0af50092 authored by lilinleeli1234's avatar lilinleeli1234 Committed by vipwzw

add evm address decode

parent ca504f2c
...@@ -19,6 +19,7 @@ package abi ...@@ -19,6 +19,7 @@ package abi
import ( import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"github.com/33cn/plugin/plugin/dapp/evm/executor/vm/common"
"reflect" "reflect"
"strings" "strings"
) )
...@@ -215,6 +216,10 @@ func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) { ...@@ -215,6 +216,10 @@ func (arguments Arguments) UnpackValues(data []byte) ([]interface{}, error) {
// Calculate the full array size to get the correct offset for the next argument. // Calculate the full array size to get the correct offset for the next argument.
// Decrement it by 1, as the normal index increment is still applied. // Decrement it by 1, as the normal index increment is still applied.
virtualArgs += getArraySize(&arg.Type) - 1 virtualArgs += getArraySize(&arg.Type) - 1
} else if arg.Type.T == AddressTy {
if H160Addr , ok := marshalledValue.(common.Hash160Address); ok {
marshalledValue = H160Addr.ToAddress().String()
}
} }
if err != nil { if err != nil {
return nil, err return nil, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment