diff --git a/contracts/package.json b/contracts/package.json index 07f3d0a51..dcd15fa8f 100644 --- a/contracts/package.json +++ b/contracts/package.json @@ -14,6 +14,7 @@ "ethereum-cryptography": "^0.1.3", "mocha": "^9.0.0", "prettier": "^2.5.1", + "rpc-websockets": "<=7.10.0", "secp256k1": "^4.0.2", "ts-mocha": "^8.0.0", "typescript": "^4.5.4" diff --git a/contracts/yarn.lock b/contracts/yarn.lock index 5386cde3e..5857fe650 100644 --- a/contracts/yarn.lock +++ b/contracts/yarn.lock @@ -1209,6 +1209,19 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rpc-websockets@<=7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.10.0.tgz#8ffaf6aaab3eb18e603c7549988cf49feeddcd29" + integrity sha512-cemZ6RiDtYZpPiBzYijdOrkQQzmBCmug0E9SdRH2gIUNT15ql4mwCYWIp0VnSZq6Qrw/JkGUygp4PrK1y9KfwQ== + dependencies: + "@babel/runtime" "^7.17.2" + eventemitter3 "^4.0.7" + uuid "^8.3.2" + ws "^8.5.0" + optionalDependencies: + bufferutil "^4.0.1" + utf-8-validate "^5.0.2" + rpc-websockets@^7.5.0: version "7.5.0" resolved "https://registry.yarnpkg.com/rpc-websockets/-/rpc-websockets-7.5.0.tgz#bbeb87572e66703ff151e50af1658f98098e2748" diff --git a/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts b/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts index b23a6d856..b69671cd7 100644 --- a/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts +++ b/gauntlet/packages/gauntlet-solana/src/commands/middlewares.ts @@ -21,7 +21,10 @@ export const withProvider: Middleware = (c: SolanaCommand, next: Next) => { if (wsUrl) { assertions.assert(isValidURL(wsUrl), `Invalid WS_URL (${wsUrl}), please add an ws:// or wss:// prefix`) } - c.provider = new AnchorProvider(new Connection(nodeURL, wsUrl ? { wsEndpoint: wsUrl } : {}), c.wallet, {}) + c.provider = new AnchorProvider(new Connection(nodeURL, wsUrl ? { wsEndpoint: wsUrl } : {}), c.wallet, { + preflightCommitment: 'confirmed', // use confirmed commitment + commitment: 'confirmed', + }) return next() }