Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ethclient: apply accessList field in toCallArg #28832

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ethclient/ethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,16 @@ func toCallArg(msg ethereum.CallMsg) interface{} {
if msg.GasTipCap != nil {
arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap)
}
if msg.AccessList != nil {
accessListArg := make([]map[string]interface{}, len(msg.AccessList))
colinlyguo marked this conversation as resolved.
Show resolved Hide resolved
for i, access := range msg.AccessList {
accessListArg[i] = map[string]interface{}{
"address": access.Address,
"storageKeys": access.StorageKeys,
}
}
arg["accessList"] = accessListArg
}
return arg
}

Expand Down
16 changes: 16 additions & 0 deletions ethclient/gethclient/gethclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,22 @@ func toCallArg(msg ethereum.CallMsg) interface{} {
if msg.GasPrice != nil {
arg["gasPrice"] = (*hexutil.Big)(msg.GasPrice)
}
if msg.GasFeeCap != nil {
arg["maxFeePerGas"] = (*hexutil.Big)(msg.GasFeeCap)
}
if msg.GasTipCap != nil {
arg["maxPriorityFeePerGas"] = (*hexutil.Big)(msg.GasTipCap)
}
if msg.AccessList != nil {
accessListArg := make([]map[string]interface{}, len(msg.AccessList))
for i, access := range msg.AccessList {
accessListArg[i] = map[string]interface{}{
"address": access.Address,
"storageKeys": access.StorageKeys,
}
}
arg["accessList"] = accessListArg
}
return arg
}

Expand Down