@@ -3,10 +3,11 @@ package async_commitment
33import (
44 "context"
55 "crypto/ed25519"
6+ "crypto/rand"
67 "encoding/hex"
78 "fmt"
89 "math"
9- "math/rand"
10+ mrand "math/rand"
1011 "testing"
1112 "time"
1213
@@ -123,7 +124,7 @@ func (e testEnv) simulateCommitment(t *testing.T, recentRoot string, state commi
123124 Amount : kin .ToQuarks (1 ),
124125
125126 Intent : testutil .NewRandomAccount (t ).PublicKey ().ToBase58 (),
126- ActionId : rand .Uint32 (),
127+ ActionId : mrand .Uint32 (),
127128
128129 Owner : testutil .NewRandomAccount (t ).PublicKey ().ToBase58 (),
129130
@@ -178,7 +179,7 @@ func (e testEnv) simulateCommitment(t *testing.T, recentRoot string, state commi
178179
179180 FulfillmentType : fulfillment .TemporaryPrivacyTransferWithAuthority ,
180181 Data : []byte ("data" ),
181- Signature : pointer .String (fmt .Sprintf ("sig%d" , rand .Uint64 ())),
182+ Signature : pointer .String (fmt .Sprintf ("sig%d" , mrand .Uint64 ())),
182183
183184 Nonce : pointer .String (testutil .NewRandomAccount (t ).PublicKey ().ToBase58 ()),
184185 Blockhash : pointer .String ("bh" ),
@@ -276,7 +277,7 @@ func (e testEnv) simulateCommitmentBeingUpgraded(t *testing.T, upgradeFrom, upgr
276277
277278 permanentPrivacyFulfillment := fulfillmentRecords [0 ].Clone ()
278279 permanentPrivacyFulfillment .Id = 0
279- permanentPrivacyFulfillment .Signature = pointer .String (fmt .Sprintf ("txn%d" , rand .Uint64 ()))
280+ permanentPrivacyFulfillment .Signature = pointer .String (fmt .Sprintf ("txn%d" , mrand .Uint64 ()))
280281 permanentPrivacyFulfillment .FulfillmentType = fulfillment .PermanentPrivacyTransferWithAuthority
281282 permanentPrivacyFulfillment .Destination = & upgradeTo .Vault
282283 require .NoError (t , e .data .PutAllFulfillments (e .ctx , & permanentPrivacyFulfillment ))
@@ -492,7 +493,8 @@ func (e *testEnv) generateAvailableNonce(t *testing.T) *nonce.Record {
492493 nonceAccount := testutil .NewRandomAccount (t )
493494
494495 var bh solana.Blockhash
495- rand .Read (bh [:])
496+ _ , err := rand .Read (bh [:])
497+ require .NoError (t , err )
496498
497499 nonceKey := & vault.Record {
498500 PublicKey : nonceAccount .PublicKey ().ToBase58 (),
0 commit comments