Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
张蕾
Geth-Modification
Commits
bb1f7ebf
Unverified
Commit
bb1f7ebf
authored
Aug 23, 2021
by
Felix Lange
Committed by
GitHub
Aug 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
signer/core/apitypes: remove dependency on internal/ethapi (#23362)
parent
d02c6053
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
16 deletions
+53
-16
types.go
signer/core/apitypes/types.go
+53
-16
No files found.
signer/core/apitypes/types.go
View file @
bb1f7ebf
...
...
@@ -19,12 +19,12 @@ package apitypes
import
(
"encoding/json"
"fmt"
"math/big"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/internal/ethapi"
)
type
ValidationInfo
struct
{
...
...
@@ -97,23 +97,60 @@ func (args SendTxArgs) String() string {
return
err
.
Error
()
}
// ToTransaction converts the arguments to a transaction.
func
(
args
*
SendTxArgs
)
ToTransaction
()
*
types
.
Transaction
{
txArgs
:=
ethapi
.
TransactionArgs
{
Gas
:
&
args
.
Gas
,
GasPrice
:
args
.
GasPrice
,
MaxFeePerGas
:
args
.
MaxFeePerGas
,
MaxPriorityFeePerGas
:
args
.
MaxPriorityFeePerGas
,
Value
:
&
args
.
Value
,
Nonce
:
&
args
.
Nonce
,
Data
:
args
.
Data
,
Input
:
args
.
Input
,
AccessList
:
args
.
AccessList
,
ChainID
:
args
.
ChainID
,
}
// Add the To-field, if specified
var
to
*
common
.
Address
if
args
.
To
!=
nil
{
to
:=
args
.
To
.
Address
()
txArgs
.
To
=
&
to
dstAddr
:=
args
.
To
.
Address
()
to
=
&
dstAddr
}
var
input
[]
byte
if
args
.
Input
!=
nil
{
input
=
*
args
.
Input
}
else
if
args
.
Data
!=
nil
{
input
=
*
args
.
Data
}
var
data
types
.
TxData
switch
{
case
args
.
MaxFeePerGas
!=
nil
:
al
:=
types
.
AccessList
{}
if
args
.
AccessList
!=
nil
{
al
=
*
args
.
AccessList
}
data
=
&
types
.
DynamicFeeTx
{
To
:
to
,
ChainID
:
(
*
big
.
Int
)(
args
.
ChainID
),
Nonce
:
uint64
(
args
.
Nonce
),
Gas
:
uint64
(
args
.
Gas
),
GasFeeCap
:
(
*
big
.
Int
)(
args
.
MaxFeePerGas
),
GasTipCap
:
(
*
big
.
Int
)(
args
.
MaxPriorityFeePerGas
),
Value
:
(
*
big
.
Int
)(
&
args
.
Value
),
Data
:
input
,
AccessList
:
al
,
}
case
args
.
AccessList
!=
nil
:
data
=
&
types
.
AccessListTx
{
To
:
to
,
ChainID
:
(
*
big
.
Int
)(
args
.
ChainID
),
Nonce
:
uint64
(
args
.
Nonce
),
Gas
:
uint64
(
args
.
Gas
),
GasPrice
:
(
*
big
.
Int
)(
args
.
GasPrice
),
Value
:
(
*
big
.
Int
)(
&
args
.
Value
),
Data
:
input
,
AccessList
:
*
args
.
AccessList
,
}
default
:
data
=
&
types
.
LegacyTx
{
To
:
to
,
Nonce
:
uint64
(
args
.
Nonce
),
Gas
:
uint64
(
args
.
Gas
),
GasPrice
:
(
*
big
.
Int
)(
args
.
GasPrice
),
Value
:
(
*
big
.
Int
)(
&
args
.
Value
),
Data
:
input
,
}
}
return
t
xArgs
.
ToTransaction
(
)
return
t
ypes
.
NewTx
(
data
)
}
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