@btc-vision/btc-runtime 1.0.25 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@btc-vision/btc-runtime",
3
- "version": "1.0.25",
3
+ "version": "1.0.27",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "types": "btc/index.ts",
@@ -154,6 +154,7 @@ export class BytesWriter {
154
154
 
155
155
  public writeBytesWithLength(value: Uint8Array): void {
156
156
  const length: u32 = u32(value.byteLength);
157
+
157
158
  this.allocSafe(length + 4);
158
159
  this.writeU32(length);
159
160
 
@@ -317,7 +318,9 @@ export class BytesWriter {
317
318
  bytes[i] = value.charCodeAt(i);
318
319
  }
319
320
 
320
- bytes[value.length] = 0;
321
+ if (value.length < i32(ADDRESS_BYTE_LENGTH)) {
322
+ bytes[value.length] = 0;
323
+ }
321
324
 
322
325
  return bytes;
323
326
  }