Skip to content

Commit

Permalink
[TS SDK] Adding test and backwards compatibility for 0.22.0 (MystenLa…
Browse files Browse the repository at this point in the history
…bs#8130)

Tested against latest main, and testnet branch.
  • Loading branch information
healthydeve authored Feb 7, 2023
1 parent daf0b9f commit e630f68
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/yellow-masks-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mysten/sui.js": patch
---

Added string option to getCheckpointContents call in SDK to support 0.22.0
2 changes: 1 addition & 1 deletion sdk/typescript/src/providers/json-rpc-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ export class JsonRpcProvider extends Provider {
}

async getCheckpointContents(
sequence_number: number,
sequence_number: number | CheckPointContentsDigest,
): Promise<CheckpointContents> {
try {
const resp = await this.client.requestWithType(
Expand Down
7 changes: 7 additions & 0 deletions sdk/typescript/test/e2e/checkpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,15 @@ describe('Checkpoints Reading API', () => {

it('get checkpoint contents', async () => {
if (shouldSkip) {
// Test for previous versions
const checkpoint_resp = await toolbox.provider.getCheckpointSummary(0);
const digest = checkpoint_resp.content_digest;
expect(digest).not.toBeNull();
const resp = await toolbox.provider.getCheckpointContents(digest!);
expect(resp.transactions.length).greaterThan(0);
return;
}

const resp = await toolbox.provider.getCheckpointContents(0);
expect(resp.transactions.length).greaterThan(0);
});
Expand Down

0 comments on commit e630f68

Please sign in to comment.