Commit ab9081e0 authored by Litian's avatar Litian

fix linter

parent 15e77af5
...@@ -133,7 +133,7 @@ func convertUint(val uint64, kind reflect.Kind) interface{} { ...@@ -133,7 +133,7 @@ func convertUint(val uint64, kind reflect.Kind) interface{} {
case reflect.Uint32: case reflect.Uint32:
return uint32(val) return uint32(val)
case reflect.Uint64: case reflect.Uint64:
return uint64(val) return val
} }
return val return val
} }
...@@ -149,7 +149,7 @@ func convertInt(val int64, kind reflect.Kind) interface{} { ...@@ -149,7 +149,7 @@ func convertInt(val int64, kind reflect.Kind) interface{} {
case reflect.Int32: case reflect.Int32:
return int32(val) return int32(val)
case reflect.Int64: case reflect.Int64:
return int64(val) return val
} }
return val return val
} }
......
...@@ -140,7 +140,7 @@ func TestEventTupleUnpack(t *testing.T) { ...@@ -140,7 +140,7 @@ func TestEventTupleUnpack(t *testing.T) {
type EventTransferWithTag struct { type EventTransferWithTag struct {
// this is valid because `value` is not exportable, // this is valid because `value` is not exportable,
// so value is only unmarshalled into `Value1`. // so value is only unmarshalled into `Value1`.
value *big.Int Value *big.Int
Value1 *big.Int `abi:"value"` Value1 *big.Int `abi:"value"`
} }
...@@ -332,29 +332,6 @@ type testResult struct { ...@@ -332,29 +332,6 @@ type testResult struct {
Value2 *big.Int Value2 *big.Int
} }
type testCase struct {
definition string
want testResult
}
func (tc testCase) encoded(intType, arrayType Type) []byte {
var b bytes.Buffer
if tc.want.Value1 != nil {
val, _ := intType.pack(reflect.ValueOf(tc.want.Value1))
b.Write(val)
}
if !reflect.DeepEqual(tc.want.Values, [2]*big.Int{nil, nil}) {
val, _ := arrayType.pack(reflect.ValueOf(tc.want.Values))
b.Write(val)
}
if tc.want.Value2 != nil {
val, _ := intType.pack(reflect.ValueOf(tc.want.Value2))
b.Write(val)
}
return b.Bytes()
}
// TestEventUnpackIndexed verifies that indexed field will be skipped by event decoder. // TestEventUnpackIndexed verifies that indexed field will be skipped by event decoder.
func TestEventUnpackIndexed(t *testing.T) { func TestEventUnpackIndexed(t *testing.T) {
definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8"},{"indexed": false, "name":"value2", "type":"uint8"}]}]` definition := `[{"name": "test", "type": "event", "inputs": [{"indexed": true, "name":"value1", "type":"uint8"},{"indexed": false, "name":"value2", "type":"uint8"}]}]`
......
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
"github.com/33cn/chain33/common/address" "github.com/33cn/chain33/common/address"
log "github.com/33cn/chain33/common/log/log15" log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
"github.com/golang/protobuf/proto"
) )
var ( var (
...@@ -142,7 +143,7 @@ func createEvmTx(param *CreateCallTx) (*types.Transaction, error) { ...@@ -142,7 +143,7 @@ func createEvmTx(param *CreateCallTx) (*types.Transaction, error) {
return createRawTx(action, param.Name, param.Fee) return createRawTx(action, param.Name, param.Fee)
} }
func createRawTx(action *EVMContractAction, name string, fee int64) (*types.Transaction, error) { func createRawTx(action proto.Message, name string, fee int64) (*types.Transaction, error) {
tx := &types.Transaction{} tx := &types.Transaction{}
if len(name) == 0 { if len(name) == 0 {
tx = &types.Transaction{ tx = &types.Transaction{
......
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