@btc-vision/btc-runtime 1.2.3 → 1.2.4

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.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "scripts": {
@@ -187,7 +187,7 @@ export class BytesReader {
187
187
  }
188
188
 
189
189
  public readAddress(): Address {
190
- return this.readString(ADDRESS_BYTE_LENGTH);
190
+ return this.readString(<u16>ADDRESS_BYTE_LENGTH);
191
191
  }
192
192
 
193
193
  public getOffset(): i32 {
@@ -242,7 +242,7 @@ export class BytesWriter {
242
242
  }
243
243
 
244
244
  private fromAddress(value: Address): Uint8Array {
245
- if (value.length > i32(ADDRESS_BYTE_LENGTH)) {
245
+ if (value.length > ADDRESS_BYTE_LENGTH) {
246
246
  throw new Revert(`Address is too long ${value.length} > ${ADDRESS_BYTE_LENGTH} bytes`);
247
247
  }
248
248
 
@@ -252,7 +252,7 @@ export class BytesWriter {
252
252
  bytes[i] = value.charCodeAt(i);
253
253
  }
254
254
 
255
- if (value.length < i32(ADDRESS_BYTE_LENGTH)) {
255
+ if (value.length < ADDRESS_BYTE_LENGTH) {
256
256
  bytes[value.length] = 0;
257
257
  }
258
258
 
@@ -1,5 +1,5 @@
1
1
  import { Potential } from '../lang/Definitions';
2
2
 
3
- export const ADDRESS_BYTE_LENGTH: u8 = 66;
3
+ export const ADDRESS_BYTE_LENGTH: i32 = 66;
4
4
  export declare type Address = string;
5
5
  export declare type PotentialAddress = Potential<Address>;