@btc-vision/btc-runtime 1.1.10 → 1.1.11

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.1.10",
3
+ "version": "1.1.11",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "types": "btc/index.ts",
@@ -11,7 +11,7 @@ export class BytesWriter {
11
11
  private currentOffset: u32 = 0;
12
12
  private buffer: DataView;
13
13
 
14
- constructor(length: i32 = 1) {
14
+ constructor(length: i32) {
15
15
  const arrayBuffer = new ArrayBuffer(length);
16
16
 
17
17
  this.buffer = new DataView(arrayBuffer);
@@ -259,7 +259,7 @@ export class BytesWriter {
259
259
 
260
260
  private resize(size: u32): void {
261
261
  abort(
262
- `Buffer is getting resized. This is very bad for performance. Expected size: ${size} - Current size: ${this.buffer.byteLength}`,
262
+ `Buffer is getting resized. This is very bad for performance. Expected size: ${this.buffer.byteLength + size} - Current size: ${this.buffer.byteLength}`,
263
263
  );
264
264
 
265
265
  /*const buf: Uint8Array = new Uint8Array(u32(this.buffer.byteLength) + size);
@@ -210,11 +210,11 @@ export abstract class DeployableOP_20 extends OP_NET implements IOP_20 {
210
210
  response.writeU8(this.decimals);
211
211
  break;
212
212
  case encodeSelector('name'):
213
- response = new BytesWriter(this.name.length + 1);
213
+ response = new BytesWriter(this.name.length + 2);
214
214
  response.writeStringWithLength(this.name);
215
215
  break;
216
216
  case encodeSelector('symbol'):
217
- response = new BytesWriter(this.symbol.length + 1);
217
+ response = new BytesWriter(this.symbol.length + 2);
218
218
  response.writeStringWithLength(this.symbol);
219
219
  break;
220
220
  case encodeSelector('totalSupply'):