Skip to content

Commit

Permalink
fix a couple flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes-mysten committed Jun 18, 2024
1 parent 42d81cb commit 18ca350
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sdk/typescript/src/transactions/json-rpc-resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ async function resolveObjectReferences(

const invalidObjects = Array.from(responsesById)
.filter(([_, obj]) => obj.error)
.map(([id, _obj]) => id);
.map(([_, obj]) => JSON.stringify(obj.error));

if (invalidObjects.length) {
throw new Error(`The following input objects are invalid: ${invalidObjects.join(', ')}`);
Expand Down
3 changes: 3 additions & 0 deletions sdk/typescript/test/e2e/object-vector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ describe('Test Move call with a vector of objects as input', () => {
showEffects: true,
},
});

await toolbox.client.waitForTransaction({ digest: result.digest });
expect(result.effects?.status.status).toEqual('success');
return result.effects?.created![0].reference.objectId!;
}
Expand All @@ -45,6 +47,7 @@ describe('Test Move call with a vector of objects as input', () => {
showEffects: true,
},
});
await toolbox.client.waitForTransaction({ digest: result.digest });
expect(result.effects?.status.status).toEqual('success');
}

Expand Down
3 changes: 2 additions & 1 deletion sdk/typescript/test/e2e/serial-executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,13 @@ describe('SerialExecutor', () => {
const txb3 = new Transaction();
txb3.transferObjects([newCoinId], new Ed25519Keypair().toSuiAddress());

await toolbox.client.signAndExecuteTransaction({
const { digest } = await toolbox.client.signAndExecuteTransaction({
signer: toolbox.keypair,
transaction: txb2,
});

await expect(() => executor.executeTransaction(txb3)).rejects.toThrowError();
await toolbox.client.waitForTransaction({ digest });

// // Transaction should succeed after cache reset/error
const result2 = await executor.executeTransaction(txb3);
Expand Down

0 comments on commit 18ca350

Please sign in to comment.