Skip to content

Commit 1a222bb

Browse files
committed
Fix allocated nonce purpose
1 parent c6dda79 commit 1a222bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/code/async/nonce/allocator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func (p *service) generateNonceAccountsOnSolanaMainnet(serviceCtx context.Contex
7474
p.log.Warn("The nonce pool is too small.")
7575
}
7676

77-
_, err = p.createSolanaMainnetNonce(tracedCtx)
77+
_, err = p.createSolanaMainnetNonce(tracedCtx, purpose)
7878
if err != nil {
7979
p.log.WithError(err).Warn("failure creating nonce")
8080
return err

pkg/code/async/nonce/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (p *service) getRentAmount(ctx context.Context) (uint64, error) {
9595
return p.rent, nil
9696
}
9797

98-
func (p *service) createSolanaMainnetNonce(ctx context.Context) (*nonce.Record, error) {
98+
func (p *service) createSolanaMainnetNonce(ctx context.Context, purpose nonce.Purpose) (*nonce.Record, error) {
9999
err := common.EnforceMinimumSubsidizerBalance(ctx, p.data)
100100
if err != nil {
101101
return nil, err
@@ -111,7 +111,7 @@ func (p *service) createSolanaMainnetNonce(ctx context.Context) (*nonce.Record,
111111
Authority: common.GetSubsidizer().PublicKey().ToBase58(),
112112
Environment: nonce.EnvironmentSolana,
113113
EnvironmentInstance: nonce.EnvironmentInstanceSolanaMainnet,
114-
Purpose: nonce.PurposeOnDemandTransaction, // todo: intelligently set a purpose, but most use cases require this type of nonce
114+
Purpose: purpose,
115115
State: nonce.StateUnknown,
116116
}
117117

0 commit comments

Comments
 (0)