Hello!
Wanted to flag an error I've been seeing in soroban-client 1.0.0-beta.4.
The Blend-Sdk makes use of getLedgerEntries pretty extensively to fetch contract data from chain. (this is mostly so we can fetch multiple entries at once from the RPC)
See this block of example code reading from testnet for the error:
const backstop_id = 'CDTPZ5PCK5COX73S5MABIZ3G3A6CLC3HDYQOHSXH6ZMN2VWHVRXAJO74';
const pool_id = 'CAMUSVYFN6LUKIZTKCFVP536GDU3GOBIFVGG6OJKU4EDUW6OMDTM3UZK';
const poolEpsDataKey = xdr.LedgerKey.contractData(
new xdr.LedgerKeyContractData({
contract: Address.fromString(backstop_id).toScAddress(),
key: xdr.ScVal.scvVec([
xdr.ScVal.scvSymbol('PoolEPS'),
Address.fromString(pool_id).toScVal(),
]),
durability: xdr.ContractDataDurability.persistent(),
})
);
const backstopPoolDataPromise = await stellar_rpc.getLedgerEntries(poolEpsDataKey);
console.log('Result: ', backstopPoolDataPromise);
with 1.0.0-beta.2 this produces:
Result: {
entries: [
{
key: 'AAAABgAAAAHm/PXiV0Tr/3LrABRnZtg8JYtnHiDjyuf2WN1Wx6xuBAAAABAAAAABAAAAAgAAAA8AAAAHUG9vbEVQUwAAAAASAAAAARlJVwVvl0UjM1CLV/d+MOmzOCgtTG85KqcIOlvOYObNAAAAAQ==',
xdr: 'AAAABgAAAAAAAAAB5vz14ldE6/9y6wAUZ2bYPCWLZx4g48rn9ljdVsesbgQAAAAQAAAAAQAAAAIAAAAPAAAAB1Bvb2xFUFMAAAAAEgAAAAEZSVcFb5dFIzNQi1f3fjDpszgoLUxvOSqnCDpbzmDmzQAAAAEAAAAKAAAAAAAAAAAAAAAAABt3QA==',
lastModifiedLedgerSeq: '2535782'
}
],
latestLedger: '2537751'
}
with 1.0.0-beta.4
TypeError: expiration not set
at ChildUnion.get (/Users/mootz12/dev/blend/blend-utils/node_modules/js-xdr/lib/xdr.js:1727:95)
at ChildUnion.get [as expiration] (/Users/mootz12/dev/blend/blend-utils/node_modules/js-xdr/lib/xdr.js:1836:25)
at /Users/mootz12/dev/blend/blend-utils/node_modules/soroban-client/lib/server.js:636:104
at Array.forEach (<anonymous>)
at mergeResponseExpirationLedgers (/Users/mootz12/dev/blend/blend-utils/node_modules/soroban-client/lib/server.js:626:135)
at /Users/mootz12/dev/blend/blend-utils/node_modules/soroban-client/lib/server.js:230:24
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async temp (file:///Users/mootz12/dev/blend/blend-utils/lib/scripts/temp.js:164:37)
at async file:///Users/mootz12/dev/blend/blend-utils/lib/scripts/temp.js:191:1
Suggestions on how to move forward? My current thought is patching the sequence number bug manually on the 1.0.0-beta.2 release.