Skip to content

Commit 95bade2

Browse files
author
Daisuke Kanda
committed
debug build not to use txpool_content_from
Signed-off-by: Daisuke Kanda <daisuke.kanda@datachain.jp>
1 parent c07cfde commit 95bade2

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

pkg/client/txpool/txpool.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"math/big"
66
"slices"
7+
"fmt"
78

89
"github.com/ethereum/go-ethereum/common"
910
"github.com/ethereum/go-ethereum/common/hexutil"
@@ -39,6 +40,7 @@ type RPCTransaction struct {
3940

4041
// PendingTransactions returns pending txs sent from `address` sorted by nonce.
4142
func PendingTransactions(ctx context.Context, client *ethclient.Client, address common.Address) ([]*RPCTransaction, error) {
43+
fmt.Printf("zzzPendingTransactions\n")
4244
txs, err := ContentFrom(ctx, client, address)
4345
if err != nil {
4446
return nil, err

pkg/client/txpool/txpool_content_from.debug.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build ethereum_ibc_relay_chain_debug_txpool_content_from
1+
//go:build ethereum_ibc_relay_chain_debug
22

33
package txpool
44

@@ -12,13 +12,13 @@ import (
1212

1313
// ContentFrom calls `txpool_contentFrom` of the Ethereum RPC
1414
func ContentFrom(ctx context.Context, client *ethclient.Client, address common.Address) (map[string]map[string]*RPCTransaction, error) {
15-
var res map[string]map[string]*RPCTransaction
16-
if _, ok = os.LookupEnv("RELAYER_DEBUG_TXPOOL_CONTENT_FROM"); ok {
17-
return []
15+
res := make(map[string]map[string]*RPCTransaction)
16+
val, ok := os.LookupEnv("RELAYER_SKIP_TXPOOL_CONTENT_FROM")
17+
if ok && val == "1" {
1818
} else {
1919
if err := client.Client().CallContext(ctx, &res, "txpool_contentFrom", address); err != nil {
2020
return nil, err
2121
}
22-
return res, nil
2322
}
23+
return res, nil
2424
}

pkg/client/txpool/txpool_content_from.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build !ethereum_ibc_relay_chain_debug_txpool_content_from
1+
//go:build !ethereum_ibc_relay_chain_debug
22

33
package txpool
44

0 commit comments

Comments
 (0)