Skip to content

Commit

Permalink
(fix): default address for call is now address(0).
Browse files Browse the repository at this point in the history
  • Loading branch information
indeavr committed Jan 11, 2022
1 parent a2695a5 commit 3e3c07a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-poems-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@eth-optimism/l2geth': patch
---

changed the default address to be address(0) in `call`
8 changes: 5 additions & 3 deletions l2geth/internal/ethapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,11 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNrOrHash rpc.Blo
// Set sender address or use a default if none specified
var addr common.Address
if args.From == nil {
if wallets := b.AccountManager().Wallets(); len(wallets) > 0 {
if accounts := wallets[0].Accounts(); len(accounts) > 0 {
addr = accounts[0].Address
if !rcfg.UsingOVM {
if wallets := b.AccountManager().Wallets(); len(wallets) > 0 {
if accounts := wallets[0].Accounts(); len(accounts) > 0 {
addr = accounts[0].Address
}
}
}
} else {
Expand Down

0 comments on commit 3e3c07a

Please sign in to comment.