Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
ab9081e0
Commit
ab9081e0
authored
Nov 28, 2018
by
Litian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix linter
parent
15e77af5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
27 deletions
+5
-27
api.go
plugin/dapp/evm/executor/abi/api.go
+2
-2
event_test.go
plugin/dapp/evm/executor/abi/event_test.go
+1
-24
evm.go
plugin/dapp/evm/types/evm.go
+2
-1
No files found.
plugin/dapp/evm/executor/abi/api.go
View file @
ab9081e0
...
@@ -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
}
}
...
...
plugin/dapp/evm/executor/abi/event_test.go
View file @
ab9081e0
...
@@ -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`.
v
alue
*
big
.
Int
V
alue
*
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"}]}]`
...
...
plugin/dapp/evm/types/evm.go
View file @
ab9081e0
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment