Skip to content

Commit

Permalink
change commitment message recent to processed solves issue coral-xyz#289
Browse files Browse the repository at this point in the history
  • Loading branch information
Necmttn committed Dec 11, 2021
1 parent fcb07eb commit f590e28
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/cfo/scripts/fees.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ async function main() {
let marketClient = await Market.load(
provider.connection,
market,
{ commitment: "recent" },
{ commitment: "processed" },
DEX_PID
);
console.log("Fees: ", marketClient._decoded.quoteFeesAccrued.toString());
Expand Down
4 changes: 2 additions & 2 deletions tests/cfo/tests/cfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ describe("cfo", () => {
marketAClient = await Market.load(
program.provider.connection,
ORDERBOOK_ENV.marketA.address,
{ commitment: "recent" },
{ commitment: "processed" },
DEX_PID
);
marketBClient = await Market.load(
program.provider.connection,
ORDERBOOK_ENV.marketB.address,
{ commitment: "recent" },
{ commitment: "processed" },
DEX_PID
);
assert.ok(marketAClient._decoded.quoteFeesAccrued.toString() === FEES);
Expand Down
6 changes: 3 additions & 3 deletions tests/cfo/tests/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ async function setupMarket({
const MARKET_A_USDC = await Market.load(
provider.connection,
marketAPublicKey,
{ commitment: "recent" },
{ commitment: "processed" },
DEX_PID
);
for (let k = 0; k < asks.length; k += 1) {
Expand Down Expand Up @@ -405,7 +405,7 @@ async function signTransactions({
async function sendAndConfirmRawTransaction(
connection,
raw,
commitment = "recent"
commitment = "processed"
) {
let tx = await connection.sendRawTransaction(raw, {
skipPreflight: true,
Expand Down Expand Up @@ -433,7 +433,7 @@ async function runTradeBot(market, provider, iterations = undefined) {
let marketClient = await Market.load(
provider.connection,
market,
{ commitment: "recent" },
{ commitment: "processed" },
DEX_PID
);
const baseTokenUser1 = (
Expand Down
4 changes: 2 additions & 2 deletions tests/swap/tests/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ async function setupMarket({
const MARKET_A_USDC = await Market.load(
provider.connection,
marketAPublicKey,
{ commitment: "recent" },
{ commitment: "processed" },
DEX_PID
);
for (let k = 0; k < asks.length; k += 1) {
Expand Down Expand Up @@ -476,7 +476,7 @@ async function signTransactions({
async function sendAndConfirmRawTransaction(
connection,
raw,
commitment = "recent"
commitment = "processed"
) {
let tx = await connection.sendRawTransaction(raw, {
skipPreflight: true,
Expand Down
6 changes: 3 additions & 3 deletions ts/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export default class Provider {

static defaultOptions(): ConfirmOptions {
return {
preflightCommitment: "recent",
commitment: "recent",
preflightCommitment: "processed",
commitment: "processed",
};
}

Expand Down Expand Up @@ -207,7 +207,7 @@ export default class Provider {
return await simulateTransaction(
this.connection,
tx,
opts.commitment ?? this.opts.commitment ?? "recent"
opts.commitment ?? this.opts.commitment ?? "processed"
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion ts/src/utils/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function getMultipleAccountsCore(
): Promise<
Array<null | { publicKey: PublicKey; account: AccountInfo<Buffer> }>
> {
const args = [publicKeys.map((k) => k.toBase58()), { commitment: "recent" }];
const args = [publicKeys.map((k) => k.toBase58()), { commitment: "processed" }];
// @ts-ignore
const res = await connection._rpcRequest("getMultipleAccounts", args);
if (res.error) {
Expand Down

0 comments on commit f590e28

Please sign in to comment.