mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
3163f40e58
- Added new requests for sending raw transactions - Made provisions for other types of transactions generated, including contracts - Modified the models and services to accommodate general values
19 lines
470 B
Go
19 lines
470 B
Go
package services
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/models"
|
|
"github.com/ledgerwatch/erigon/cmd/devnet/requests"
|
|
"github.com/ledgerwatch/erigon/common"
|
|
)
|
|
|
|
func GetNonce(reqId int, address common.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
|
|
}
|