[Node.js] deserialize fails because Buffers are converted to arrays
- Lingua principale
- TypeScript
- Stelle
- 1
- Fork
- 21
- Merge medio
- 12h 14m
- PR unite (30g)
- 41
Descrizione
### Packages versions
@miden-sdk/miden-sdk@0.16.0-rc.5
### Bug description
In Node.js, the SDK wrapper converts `Buffer` and `Uint8Array` arguments into plain arrays.
`AuthSecretKey.deserialize()` expects a `Buffer`, so it fails through the public SDK export.
This also affects `Word.deserialize()`. Calling the same method through `getNativeModule()` works because it bypasses the wrapper.
### How can this be reproduced?
import { AuthSecretKey } from "@miden-sdk/miden-sdk";
const key = AuthSecretKey.rpoFalconWithRNG(new Uint8Array(32));
const base64 = key.serialize().toString("base64");
AuthSecretKey.deserialize(Buffer.from(base64, "base64"));
### Relevant log output
```shell
Failed to get Buffer pointer and length
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Look at the SDK wrapper code that handles serialization/deserialization, likely in a file like `src/wrapper.ts` or `src/serialization.ts`. Identify where Buffer/Uint8Array arguments are being converted to plain arrays. The fix involves ensuring the native module receives the correct type. Test by running the reproduction script and checking that AuthSecretKey.deserialize works with a Buffer input.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js, typescript
- Ambito
- api, backend, devtools
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Attiva
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 65/100