sdk/js-query: fix SolanaPda mock for bad rentEpoch parsing
This commit is contained in:
parent
2d141a1247
commit
405bd58580
|
@ -1,3 +1,11 @@
|
|||
## 0.0.12
|
||||
|
||||
Fix SolanaPda mock for bad rentEpoch parsing
|
||||
|
||||
## 0.0.11
|
||||
|
||||
Add Solana PDA support
|
||||
|
||||
## 0.0.10
|
||||
|
||||
Fix SolanaAccount mock for bad rentEpoch parsing
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@wormhole-foundation/wormhole-query-sdk",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@wormhole-foundation/wormhole-query-sdk",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@ethersproject/keccak256": "^5.7.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@wormhole-foundation/wormhole-query-sdk",
|
||||
"version": "0.0.11",
|
||||
"version": "0.0.12",
|
||||
"description": "Wormhole cross-chain query SDK",
|
||||
"homepage": "https://wormhole.com",
|
||||
"main": "./lib/cjs/index.js",
|
||||
|
|
|
@ -559,11 +559,18 @@ export class QueryProxyMock {
|
|||
let results: SolanaPdaResult[] = [];
|
||||
let idx = 0;
|
||||
response.data.result.value.forEach((val) => {
|
||||
const rentEpoch = BigInt(val.rentEpoch);
|
||||
results.push({
|
||||
account: Uint8Array.from(base58.decode(accounts[idx].toString())),
|
||||
bump: bumps[idx],
|
||||
lamports: BigInt(val.lamports),
|
||||
rentEpoch: BigInt(val.rentEpoch),
|
||||
rentEpoch:
|
||||
// this is a band-aid for an axios / JSON.parse effect where numbers > Number.MAX_SAFE_INTEGER are not parsed correctly
|
||||
// e.g. 18446744073709551615 becomes 18446744073709552000
|
||||
// https://github.com/axios/axios/issues/4846
|
||||
rentEpoch > SOLANA_MAX_RENT_EPOCH
|
||||
? SOLANA_MAX_RENT_EPOCH
|
||||
: rentEpoch,
|
||||
executable: Boolean(val.executable),
|
||||
owner: Uint8Array.from(base58.decode(val.owner.toString())),
|
||||
data: Uint8Array.from(
|
||||
|
|
Loading…
Reference in New Issue