mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-07 03:22:18 +00:00
20 lines
488 B
Go
20 lines
488 B
Go
package services
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
|
|
)
|
|
|
|
func GetNonce(reqId int, address libcommon.Address) (uint64, error) {
|
|
res, err := requests.GetTransactionCount(reqId, address, models.Latest)
|
|
if err != nil {
|
|
return 0, fmt.Errorf("failed to get transaction count for address 0x%x: %v", address, err)
|
|
}
|
|
|
|
return uint64(res.Result), nil
|
|
}
|