feat: add dataSlice param to account fetching config (#28389)
This commit is contained in:
parent
f627b7d826
commit
36e5f33e67
|
@ -470,6 +470,8 @@ export type GetAccountInfoConfig = {
|
||||||
commitment?: Commitment;
|
commitment?: Commitment;
|
||||||
/** The minimum slot that the request can be evaluated at */
|
/** The minimum slot that the request can be evaluated at */
|
||||||
minContextSlot?: number;
|
minContextSlot?: number;
|
||||||
|
/** Optional data slice to limit the returned account data */
|
||||||
|
dataSlice?: DataSlice;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2396,6 +2398,8 @@ export type GetMultipleAccountsConfig = {
|
||||||
commitment?: Commitment;
|
commitment?: Commitment;
|
||||||
/** The minimum slot that the request can be evaluated at */
|
/** The minimum slot that the request can be evaluated at */
|
||||||
minContextSlot?: number;
|
minContextSlot?: number;
|
||||||
|
/** Optional data slice to limit the returned account data */
|
||||||
|
dataSlice?: DataSlice;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4505,8 +4505,9 @@ describe('Connection', function () {
|
||||||
const transferToKey = lookupTableAddresses[0];
|
const transferToKey = lookupTableAddresses[0];
|
||||||
const transferToAccount = await connection.getAccountInfo(
|
const transferToAccount = await connection.getAccountInfo(
|
||||||
transferToKey,
|
transferToKey,
|
||||||
'confirmed',
|
{commitment: 'confirmed', dataSlice: {length: 0, offset: 0}},
|
||||||
);
|
);
|
||||||
|
expect(transferToAccount?.data.length).to.be.eq(0);
|
||||||
expect(transferToAccount?.lamports).to.be.eq(LAMPORTS_PER_SOL);
|
expect(transferToAccount?.lamports).to.be.eq(LAMPORTS_PER_SOL);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue