diff --git a/package.json b/package.json index e5138ca9..f332d185 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "@solana/spl-token": "^0.3.6", "@solana/web3.js": "^1.73.0", "@types/jest": "^29.2.5", + "crypto": "^1.0.1", "jest": "^29.3.1", "ts-jest": "^29.0.3", "typescript": "^4.9.4" diff --git a/tests/client.test.ts b/tests/client.test.ts index a4db470d..eae75ad6 100644 --- a/tests/client.test.ts +++ b/tests/client.test.ts @@ -1,6 +1,7 @@ import { Connection, Keypair, sendAndConfirmTransaction, Transaction, PublicKey, TransactionInstruction, BlockheightBasedTransactionConfirmationStrategy } from "@solana/web3.js"; import * as fs from "fs"; import * as os from "os"; +import * as crypto from "crypto"; jest.setTimeout(60000); @@ -16,7 +17,7 @@ function createTransaction(): Transaction { new TransactionInstruction({ programId: MEMO_PROGRAM_ID, keys: [], - data: Buffer.from("Hello") + data: Buffer.from(crypto.randomBytes(20).toString('hex')) }) ); diff --git a/yarn.lock b/yarn.lock index 46b4f993..deb7ba81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1114,6 +1114,11 @@ cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" +crypto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/crypto/-/crypto-1.0.1.tgz#2af1b7cad8175d24c8a1b0778255794a21803037" + integrity sha512-VxBKmeNcqQdiUQUW2Tzq0t377b54N2bMtXO/qiLa+6eRRmmC4qT3D4OnTGoT/U6O9aklQ/jTwbOtRMTTY8G0Ig== + debug@^4.1.0, debug@^4.1.1: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz"