Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions tests/integration/tests/test-delegation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ describe("TestDelegation", () => {
});

it("Commit a new state to the PDA", async () => {
let account = await provider.connection.getAccountInfo(pda);
let new_data = account.data;
new_data[-1] = (new_data[-1] + 1) % 256;
const account = await provider.connection.getAccountInfo(pda);
const new_data = account.data;

const lastIndex = new_data.length - 1;
new_data[lastIndex] = (new_data[lastIndex] + 1) % 256;

const args: CommitAccountInstructionArgs = {
slot: new anchor.BN(1),
Expand Down Expand Up @@ -316,9 +318,11 @@ describe("TestDelegation", () => {
});

it("Commit a new state to the PDA", async () => {
let account = await provider.connection.getAccountInfo(pda);
let new_data = account.data;
new_data[-1] = (new_data[-1] + 1) % 256;
const account = await provider.connection.getAccountInfo(pda);
const new_data = account.data;

const lastIndex = new_data.length - 1;
new_data[lastIndex] = (new_data[lastIndex] + 1) % 256;

const args: CommitAccountInstructionArgs = {
slot: new anchor.BN(2),
Expand Down