mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 11:32:20 +00:00
32 lines
709 B
Go
32 lines
709 B
Go
package requests
|
|
|
|
import (
|
|
"crypto/ecdsa"
|
|
"fmt"
|
|
"github.com/ledgerwatch/erigon/cmd/rpctest/rpctest"
|
|
"github.com/ledgerwatch/erigon/common"
|
|
)
|
|
|
|
func GetBalance(address common.Address, blockNum string) {
|
|
reqGen := initialiseRequestGenerator()
|
|
var b rpctest.EthBalance
|
|
|
|
res := reqGen.Erigon("eth_getBalance", reqGen.getBalance(address, blockNum), &b)
|
|
if res.Err != nil {
|
|
fmt.Printf("Error getting balance: %v\n", res.Err)
|
|
return
|
|
}
|
|
|
|
fmt.Printf("Balance is: %v\n", b.Balance.ToInt())
|
|
}
|
|
|
|
func SendTx(from *ecdsa.PrivateKey, to common.Address, value uint64) {
|
|
fmt.Printf("from is: %v", from)
|
|
fmt.Printf("to is: %v", to)
|
|
fmt.Printf("value is: %v", value)
|
|
}
|
|
|
|
func TxpoolContent() string {
|
|
return ""
|
|
}
|