You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: change Material.metadata from string to Uint8Array
metadata is binary data (SCALE-encoded runtime metadata) but was stored as hex strings, requiring constant encoding/decoding. using Uint8Array eliminates this overhead and improves type safety.
changes:
- TypeScript: Material.metadata is now Uint8Array instead of string
- Rust: Material.metadata is now Vec<u8> instead of String
- MaterialJs WASM wrapper: accepts &[u8] instead of &str
- removed all decode_metadata functions (no longer needed)
- test fixtures: added hexToUint8Array() and getWestendMetadata() helpers
- added hex_or_bytes serde deserializer for backwards compatibility with JSON tests
benefits:
- eliminates hex encode/decode overhead at every use
- reduces memory usage (hex strings are 2x the size of raw bytes)
- improves type safety (Uint8Array clearly indicates binary data)
- matches wasm-utxo conventions (Uint8Array everywhere)
BTC-3085
0 commit comments