erigon-pulse/cmd/devnet/requests/tx.go
Leonard Chinonso 726ed8462d
Setup calls for rpc testing (#5661)
Setup calls for rpc testing
- Added call requests for testing rpc calls
- Added new methods getBalance and txPool content
2022-10-11 13:34:32 +01:00

26 lines
584 B
Go

package requests
import (
"fmt"
"github.com/ledgerwatch/erigon/cmd/devnet/devnetutils"
"github.com/ledgerwatch/erigon/cmd/rpctest/rpctest"
)
func TxpoolContent(reqId int) error {
reqGen := initialiseRequestGenerator(reqId)
var b rpctest.EthTxPool
if res := reqGen.Erigon("txpool_content", reqGen.txpoolContent(), &b); res.Err != nil {
return fmt.Errorf("failed to fetch txpool content: %v", res.Err)
}
s, err := devnetutils.ParseResponse(b)
if err != nil {
return fmt.Errorf("error parsing resonse: %v", err)
}
fmt.Printf("Txpool content: %v\n", s)
return nil
}