Skip to content

Commit

Permalink
change tag to pending
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds committed Mar 7, 2024
1 parent fe57ced commit e96ff3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions relayer/pkg/chainlink/txm/txm.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,8 @@ func (txm *starktxm) broadcast(ctx context.Context, publicKey *felt.Felt, accoun
tx.Signature = signature

// get fee for tx
// optional - pass nonce to fee estimate (if nonce gets ahead, estimate may fail)
// can we estimate fee without calling estimate - tbd with 1.0
simFlags := []starknetrpc.SimulationFlag{starknetrpc.SKIP_VALIDATE}
feeEstimate, err := account.EstimateFee(ctx, []starknetrpc.BroadcastTxn{tx}, simFlags, starknetrpc.BlockID{Tag: "latest"})
feeEstimate, err := account.EstimateFee(ctx, []starknetrpc.BroadcastTxn{tx}, simFlags, starknetrpc.BlockID{Tag: "pending"})
if err != nil {
var data any
if err, ok := err.(ethrpc.DataError); ok {
Expand Down
2 changes: 1 addition & 1 deletion relayer/pkg/starknet/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,5 +203,5 @@ func (c *Client) AccountNonce(ctx context.Context, accountAddress *felt.Felt) (*
if err != nil {
return nil, errors.Wrap(err, "error in client.AccountNonce")
}
return account.Nonce(ctx, starknetrpc.BlockID{Tag: "latest"}, account.AccountAddress)
return account.Nonce(ctx, starknetrpc.BlockID{Tag: "pending"}, account.AccountAddress)
}

0 comments on commit e96ff3c

Please sign in to comment.