good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
12c964b2
Commit
12c964b2
authored
Dec 20, 2016
by
Felix Lange
Browse files
Options
Downloads
Patches
Plain Diff
internal/ethapi: fix hex handling for eth_call input and eth_sendRawTransaction
parent
cf71f5cd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
eth/bind.go
+2
-2
2 additions, 2 deletions
eth/bind.go
internal/ethapi/api.go
+4
-4
4 additions, 4 deletions
internal/ethapi/api.go
with
6 additions
and
6 deletions
eth/bind.go
+
2
−
2
View file @
12c964b2
...
@@ -84,7 +84,7 @@ func toCallArgs(msg ethereum.CallMsg) ethapi.CallArgs {
...
@@ -84,7 +84,7 @@ func toCallArgs(msg ethereum.CallMsg) ethapi.CallArgs {
args
:=
ethapi
.
CallArgs
{
args
:=
ethapi
.
CallArgs
{
To
:
msg
.
To
,
To
:
msg
.
To
,
From
:
msg
.
From
,
From
:
msg
.
From
,
Data
:
common
.
ToHex
(
msg
.
Data
)
,
Data
:
msg
.
Data
,
}
}
if
msg
.
Gas
!=
nil
{
if
msg
.
Gas
!=
nil
{
args
.
Gas
=
hexutil
.
Big
(
*
msg
.
Gas
)
args
.
Gas
=
hexutil
.
Big
(
*
msg
.
Gas
)
...
@@ -135,6 +135,6 @@ func (b *ContractBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg)
...
@@ -135,6 +135,6 @@ func (b *ContractBackend) EstimateGas(ctx context.Context, msg ethereum.CallMsg)
// into the pending pool for execution.
// into the pending pool for execution.
func
(
b
*
ContractBackend
)
SendTransaction
(
ctx
context
.
Context
,
tx
*
types
.
Transaction
)
error
{
func
(
b
*
ContractBackend
)
SendTransaction
(
ctx
context
.
Context
,
tx
*
types
.
Transaction
)
error
{
raw
,
_
:=
rlp
.
EncodeToBytes
(
tx
)
raw
,
_
:=
rlp
.
EncodeToBytes
(
tx
)
_
,
err
:=
b
.
txapi
.
SendRawTransaction
(
ctx
,
common
.
ToHex
(
raw
)
)
_
,
err
:=
b
.
txapi
.
SendRawTransaction
(
ctx
,
raw
)
return
err
return
err
}
}
This diff is collapsed.
Click to expand it.
internal/ethapi/api.go
+
4
−
4
View file @
12c964b2
...
@@ -485,7 +485,7 @@ type CallArgs struct {
...
@@ -485,7 +485,7 @@ type CallArgs struct {
Gas
hexutil
.
Big
`json:"gas"`
Gas
hexutil
.
Big
`json:"gas"`
GasPrice
hexutil
.
Big
`json:"gasPrice"`
GasPrice
hexutil
.
Big
`json:"gasPrice"`
Value
hexutil
.
Big
`json:"value"`
Value
hexutil
.
Big
`json:"value"`
Data
string
`json:"data"`
Data
hexutil
.
Bytes
`json:"data"`
}
}
func
(
s
*
PublicBlockChainAPI
)
doCall
(
ctx
context
.
Context
,
args
CallArgs
,
blockNr
rpc
.
BlockNumber
)
(
string
,
*
big
.
Int
,
error
)
{
func
(
s
*
PublicBlockChainAPI
)
doCall
(
ctx
context
.
Context
,
args
CallArgs
,
blockNr
rpc
.
BlockNumber
)
(
string
,
*
big
.
Int
,
error
)
{
...
@@ -517,7 +517,7 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
...
@@ -517,7 +517,7 @@ func (s *PublicBlockChainAPI) doCall(ctx context.Context, args CallArgs, blockNr
if
gasPrice
.
Cmp
(
common
.
Big0
)
==
0
{
if
gasPrice
.
Cmp
(
common
.
Big0
)
==
0
{
gasPrice
=
new
(
big
.
Int
)
.
Mul
(
big
.
NewInt
(
50
),
common
.
Shannon
)
gasPrice
=
new
(
big
.
Int
)
.
Mul
(
big
.
NewInt
(
50
),
common
.
Shannon
)
}
}
msg
:=
types
.
NewMessage
(
addr
,
args
.
To
,
0
,
args
.
Value
.
ToInt
(),
gas
,
gasPrice
,
common
.
FromHex
(
args
.
Data
)
,
false
)
msg
:=
types
.
NewMessage
(
addr
,
args
.
To
,
0
,
args
.
Value
.
ToInt
(),
gas
,
gasPrice
,
args
.
Data
,
false
)
// Execute the call and return
// Execute the call and return
vmenv
,
vmError
,
err
:=
s
.
b
.
GetVMEnv
(
ctx
,
msg
,
state
,
header
)
vmenv
,
vmError
,
err
:=
s
.
b
.
GetVMEnv
(
ctx
,
msg
,
state
,
header
)
...
@@ -1056,9 +1056,9 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen
...
@@ -1056,9 +1056,9 @@ func (s *PublicTransactionPoolAPI) SendTransaction(ctx context.Context, args Sen
// SendRawTransaction will add the signed transaction to the transaction pool.
// SendRawTransaction will add the signed transaction to the transaction pool.
// The sender is responsible for signing the transaction and using the correct nonce.
// The sender is responsible for signing the transaction and using the correct nonce.
func
(
s
*
PublicTransactionPoolAPI
)
SendRawTransaction
(
ctx
context
.
Context
,
encodedTx
string
)
(
string
,
error
)
{
func
(
s
*
PublicTransactionPoolAPI
)
SendRawTransaction
(
ctx
context
.
Context
,
encodedTx
hexutil
.
Bytes
)
(
string
,
error
)
{
tx
:=
new
(
types
.
Transaction
)
tx
:=
new
(
types
.
Transaction
)
if
err
:=
rlp
.
DecodeBytes
(
common
.
FromHex
(
encodedTx
)
,
tx
);
err
!=
nil
{
if
err
:=
rlp
.
DecodeBytes
(
encodedTx
,
tx
);
err
!=
nil
{
return
""
,
err
return
""
,
err
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment