algorand / algorand/js-algorand-sdk
Algodv2.block() throws for some blocks (v3.0.0)
- Lingua principale
- TypeScript
- Stelle
- 297
- Fork
- 214
- Merge medio
- 1h 3m
- PR unite (30g)
- 3
Descrizione
### Subject of the issue
Certain blocks make algodv2 client throw this error: `Error: Invalid byte array: (object) null`
One such block is `44295768`
Repro:
```js
import algosdk from 'algosdk';
const algod = new algosdk.Algodv2('', 'https://mainnet-api.4160.nodely.dev', 443);
try {
const data = await algod.block(44295768).do();
} catch(e) {
console.error('oops', e);
}
```
Results in:
```
oops Error: Invalid byte array: (object) null
at ByteArraySchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/bytearray.js:23:15)
at file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:65
at Array.map ()
at ArraySchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:28)
at OptionalSchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/optional.js:38:33)
at NamedMapSchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/map.js:106:54)
at NamedMapSchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/map.js:106:54)
at file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:65
at Array.map ()
at ArraySchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/algosdk@3.0.0/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:28)
```
### Your environment
* algosdk: v3.0.0
* Operating System: Ubuntu 22.04
* Node: v20.11.0
### Steps to reproduce
1. See above
### Expected behaviour
Block returned
### Actual behaviour
Error thrown
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.