mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-10 21:11:20 +00:00
c408281d3b
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
21 lines
548 B
Go
21 lines
548 B
Go
package services
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
"github.com/ledgerwatch/log/v3"
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
|
|
)
|
|
|
|
func GetNonce(reqId int, address libcommon.Address, logger log.Logger) (uint64, error) {
|
|
res, err := requests.GetTransactionCount(reqId, address, models.Latest, logger)
|
|
if err != nil {
|
|
return 0, fmt.Errorf("failed to get transaction count for address 0x%x: %v", address, err)
|
|
}
|
|
|
|
return uint64(res.Result), nil
|
|
}
|