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
c928bb7f
Commit
c928bb7f
authored
Dec 08, 2021
by
王志文
Committed by
vipwzw
Dec 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make commond exec error
parent
738291a2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
10 deletions
+11
-10
build.yml
.github/workflows/build.yml
+1
-0
Makefile
Makefile
+1
-1
go.mod
go.mod
+3
-3
go.sum
go.sum
+0
-0
pack_test.go
plugin/dapp/evm/executor/abi/pack_test.go
+2
-2
instructions.go
plugin/dapp/evm/executor/vm/runtime/instructions.go
+2
-2
instructions_test.go
plugin/dapp/evm/executor/vm/runtime/instructions_test.go
+2
-2
No files found.
.github/workflows/build.yml
View file @
c928bb7f
...
@@ -33,6 +33,7 @@ jobs:
...
@@ -33,6 +33,7 @@ jobs:
make largefile-check
make largefile-check
make checkgofmt && make fmt_go
make checkgofmt && make fmt_go
make linter
make linter
make
unit-test
:
unit-test
:
name
:
unit-test
name
:
unit-test
...
...
Makefile
View file @
c928bb7f
...
@@ -204,7 +204,7 @@ protobuf: ## Generate protbuf file of types package
...
@@ -204,7 +204,7 @@ protobuf: ## Generate protbuf file of types package
@find
./plugin/dapp
-maxdepth
2
-type
d
-name
proto
-exec
make
-C
{}
\;
@find
./plugin/dapp
-maxdepth
2
-type
d
-name
proto
-exec
make
-C
{}
\;
depends
:
##
Generate depends file of types package
depends
:
##
Generate depends file of types package
@
find ./plugin/dapp
-maxdepth
2
-type
d
-name
cmd
-exec
make
-C
{}
OUT
=
"
$(MKDIR)
build/ci"
FLAG
=
\;
@
find ./plugin/dapp
-maxdepth
2
-
print
-
type
d
-name
cmd
-exec
make
-C
{}
OUT
=
"
$(MKDIR)
build/ci"
FLAG
=
\;
help
:
##
Display this help screen
help
:
##
Display this help screen
...
...
go.mod
View file @
c928bb7f
...
@@ -17,13 +17,13 @@ require (
...
@@ -17,13 +17,13 @@ require (
github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
github.com/davecgh/go-spew v1.1.1
github.com/davecgh/go-spew v1.1.1
github.com/ethereum/go-ethereum v1.10.
0
github.com/ethereum/go-ethereum v1.10.
13
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b
github.com/golang/protobuf v1.5.2
github.com/golang/protobuf v1.5.2
github.com/golang/snappy v0.0.
3-0.20201103224600-674baa8c7fc3
github.com/golang/snappy v0.0.
4
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d
github.com/holiman/uint256 v1.
1.1
github.com/holiman/uint256 v1.
2.0
github.com/huin/goupnp v1.0.2
github.com/huin/goupnp v1.0.2
github.com/jackpal/go-nat-pmp v1.0.2
github.com/jackpal/go-nat-pmp v1.0.2
github.com/mr-tron/base58 v1.2.0
github.com/mr-tron/base58 v1.2.0
...
...
go.sum
View file @
c928bb7f
This diff is collapsed.
Click to expand it.
plugin/dapp/evm/executor/abi/pack_test.go
View file @
c928bb7f
...
@@ -90,7 +90,7 @@ func TestMethodPack(t *testing.T) {
...
@@ -90,7 +90,7 @@ func TestMethodPack(t *testing.T) {
t
.
Errorf
(
"expected %x got %x"
,
sig
,
packed
)
t
.
Errorf
(
"expected %x got %x"
,
sig
,
packed
)
}
}
var
addrA
,
addrB
=
common
.
Uint256ToAddress
(
uint256
.
NewInt
(
)
.
SetUint64
(
1
)),
common
.
Uint256ToAddress
(
uint256
.
NewInt
()
.
SetUint64
(
1
))
var
addrA
,
addrB
=
common
.
Uint256ToAddress
(
uint256
.
NewInt
(
1
)),
common
.
Uint256ToAddress
(
uint256
.
NewInt
(
1
))
sig
=
abi
.
Methods
[
"sliceAddress"
]
.
ID
sig
=
abi
.
Methods
[
"sliceAddress"
]
.
ID
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
32
},
32
)
...
)
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
32
},
32
)
...
)
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
2
},
32
)
...
)
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
2
},
32
)
...
)
...
@@ -105,7 +105,7 @@ func TestMethodPack(t *testing.T) {
...
@@ -105,7 +105,7 @@ func TestMethodPack(t *testing.T) {
t
.
Errorf
(
"expected %x got %x"
,
sig
,
packed
)
t
.
Errorf
(
"expected %x got %x"
,
sig
,
packed
)
}
}
var
addrC
,
addrD
=
common
.
Uint256ToAddress
(
uint256
.
NewInt
(
)
.
SetUint64
(
3
)),
common
.
Uint256ToAddress
(
uint256
.
NewInt
()
.
SetUint64
(
4
))
var
addrC
,
addrD
=
common
.
Uint256ToAddress
(
uint256
.
NewInt
(
3
)),
common
.
Uint256ToAddress
(
uint256
.
NewInt
(
4
))
sig
=
abi
.
Methods
[
"sliceMultiAddress"
]
.
ID
sig
=
abi
.
Methods
[
"sliceMultiAddress"
]
.
ID
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
64
},
32
)
...
)
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
64
},
32
)
...
)
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
160
},
32
)
...
)
sig
=
append
(
sig
,
common
.
LeftPadBytes
([]
byte
{
160
},
32
)
...
)
...
...
plugin/dapp/evm/executor/vm/runtime/instructions.go
View file @
c928bb7f
...
@@ -422,7 +422,7 @@ func opExtCodeHash(pc *uint64, evm *EVM, callContext *callCtx) ([]byte, error) {
...
@@ -422,7 +422,7 @@ func opExtCodeHash(pc *uint64, evm *EVM, callContext *callCtx) ([]byte, error) {
// 获取当前区块的GasPrice
// 获取当前区块的GasPrice
func
opGasprice
(
pc
*
uint64
,
evm
*
EVM
,
callContext
*
callCtx
)
([]
byte
,
error
)
{
func
opGasprice
(
pc
*
uint64
,
evm
*
EVM
,
callContext
*
callCtx
)
([]
byte
,
error
)
{
v
:=
uint256
.
NewInt
(
)
.
SetUint64
(
uint64
(
evm
.
GasPrice
))
v
:=
uint256
.
NewInt
(
uint64
(
evm
.
GasPrice
))
callContext
.
stack
.
push
(
v
)
callContext
.
stack
.
push
(
v
)
return
nil
,
nil
return
nil
,
nil
}
}
...
@@ -954,7 +954,7 @@ func makeSwap(size int64) executionFunc {
...
@@ -954,7 +954,7 @@ func makeSwap(size int64) executionFunc {
// 获取自身余额
// 获取自身余额
func
opSelfBalance
(
pc
*
uint64
,
evm
*
EVM
,
callContext
*
callCtx
)
([]
byte
,
error
)
{
func
opSelfBalance
(
pc
*
uint64
,
evm
*
EVM
,
callContext
*
callCtx
)
([]
byte
,
error
)
{
balance
:=
uint256
.
NewInt
(
)
.
SetUint64
(
evm
.
StateDB
.
GetBalance
(
callContext
.
contract
.
Address
()
.
String
()))
balance
:=
uint256
.
NewInt
(
evm
.
StateDB
.
GetBalance
(
callContext
.
contract
.
Address
()
.
String
()))
callContext
.
stack
.
push
(
balance
)
callContext
.
stack
.
push
(
balance
)
return
nil
,
nil
return
nil
,
nil
}
}
...
...
plugin/dapp/evm/executor/vm/runtime/instructions_test.go
View file @
c928bb7f
...
@@ -574,11 +574,11 @@ func BenchmarkOpSHA3(bench *testing.B) {
...
@@ -574,11 +574,11 @@ func BenchmarkOpSHA3(bench *testing.B) {
//env.interpreter = evmInterpreter
//env.interpreter = evmInterpreter
mem
.
Resize
(
32
)
mem
.
Resize
(
32
)
pc
:=
uint64
(
0
)
pc
:=
uint64
(
0
)
start
:=
uint256
.
NewInt
()
start
:=
uint256
.
NewInt
(
0
)
bench
.
ResetTimer
()
bench
.
ResetTimer
()
for
i
:=
0
;
i
<
bench
.
N
;
i
++
{
for
i
:=
0
;
i
<
bench
.
N
;
i
++
{
stack
.
pushN
(
*
uint256
.
NewInt
(
)
.
SetUint64
(
32
),
*
start
)
stack
.
pushN
(
*
uint256
.
NewInt
(
32
),
*
start
)
opSha3
(
&
pc
,
env
,
&
callCtx
{
mem
,
stack
,
nil
})
opSha3
(
&
pc
,
env
,
&
callCtx
{
mem
,
stack
,
nil
})
}
}
}
}
...
...
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