erigon-pulse/cmd/devnet/requests/requests.go
Leonard Chinonso bb780a06d3
Tested functionalities for request_generator (#5905)
- Added tests for request_generator in devnet
- Added tests for request_generator in rpctests
2022-10-30 19:54:09 +07:00

19 lines
463 B
Go

package requests
import (
"fmt"
"github.com/ledgerwatch/erigon/cmd/devnet/models"
"github.com/ledgerwatch/erigon/p2p"
)
func AdminNodeInfo(reqId int) (p2p.NodeInfo, error) {
reqGen := initialiseRequestGenerator(reqId)
var b models.AdminNodeInfoResponse
if res := reqGen.Erigon("admin_nodeInfo", reqGen.GetAdminNodeInfo(), &b); res.Err != nil {
return p2p.NodeInfo{}, fmt.Errorf("failed to get admin node info: %v", res.Err)
}
return b.Result, nil
}