@btc-vision/btc-runtime 1.3.0 → 1.3.2

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.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "scripts": {
@@ -262,19 +262,4 @@ export class BytesReader {
262
262
 
263
263
  return result;
264
264
  }
265
-
266
- private verifyChecksum(): void {
267
- const writtenChecksum = this.readU32();
268
-
269
- let checksum: u32 = 0;
270
- for (let i = 0; i < this.buffer.byteLength; i++) {
271
- checksum += this.buffer.getUint8(i);
272
- }
273
-
274
- checksum = checksum % 2 ** 32;
275
-
276
- if (checksum !== writtenChecksum) {
277
- throw new Error('Invalid checksum for buffer');
278
- }
279
- }
280
265
  }
@@ -39,7 +39,7 @@ export class AddressMap<V> extends Map<Address, V> {
39
39
  public get(key: Address): V {
40
40
  const index: i32 = this.indexOf(key);
41
41
  if (index == -1) {
42
- throw new Revert('Key not found in map');
42
+ throw new Revert('Key not found in map (AddressMap)');
43
43
  }
44
44
  return this._values[index];
45
45
  }
@@ -55,8 +55,4 @@ export class AddressMap<V> extends Map<Address, V> {
55
55
 
56
56
  return true;
57
57
  }
58
-
59
- public getAddresses(): Address[] {
60
- return this._keys;
61
- }
62
58
  }
@@ -39,7 +39,7 @@ export class Map<K, V> {
39
39
  public get(key: K): V {
40
40
  const index: i32 = this.indexOf(key);
41
41
  if (index == -1) {
42
- throw new Revert('Key not found in map');
42
+ throw new Revert('Key not found in map (Map)');
43
43
  }
44
44
  return this._values[index];
45
45
  }
@@ -38,7 +38,7 @@ export class MapU256 extends Map<u256, u256> {
38
38
  public get(key: u256): u256 {
39
39
  const index: i32 = this.indexOf(key);
40
40
  if (index == -1) {
41
- throw new Revert('Key not found in map');
41
+ throw new Revert('Key not found in map (u256)');
42
42
  }
43
43
  return this._values[index];
44
44
  }