@btc-vision/btc-runtime 1.9.0 → 1.9.1

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.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Bitcoin Smart Contract Runtime",
5
5
  "main": "btc/index.ts",
6
6
  "scripts": {},
@@ -19,6 +19,7 @@ import {
19
19
  U256_BYTE_LENGTH,
20
20
  U32_BYTE_LENGTH,
21
21
  U64_BYTE_LENGTH,
22
+ U8_BYTE_LENGTH,
22
23
  } from '../utils';
23
24
  import { IOP20 } from './interfaces/IOP20';
24
25
  import { OP20InitParameters } from './interfaces/OP20InitParameters';
@@ -348,7 +349,13 @@ export abstract class OP20 extends OP_NET implements IOP20 {
348
349
  const iconLength = String.UTF8.byteLength(icon);
349
350
 
350
351
  const totalSize =
351
- 4 + nameLength + 4 + symbolLength + 1 + U256_BYTE_LENGTH + 4 + iconLength + 32;
352
+ U32_BYTE_LENGTH * 4 +
353
+ U256_BYTE_LENGTH * 2 +
354
+ nameLength +
355
+ symbolLength +
356
+ iconLength +
357
+ domainSeparator.length +
358
+ U8_BYTE_LENGTH;
352
359
 
353
360
  const w = new BytesWriter(totalSize);
354
361
  w.writeStringWithLength(name);
@@ -1,4 +1,9 @@
1
- import { bigEndianAdd, GET_EMPTY_BUFFER, readLengthAndStartIndex, writeLengthAndStartIndex, } from '../../math/bytes';
1
+ import {
2
+ bigEndianAdd,
3
+ GET_EMPTY_BUFFER,
4
+ readLengthAndStartIndex,
5
+ writeLengthAndStartIndex,
6
+ } from '../../math/bytes';
2
7
  import { Blockchain } from '../../env';
3
8
  import { Revert } from '../../types/Revert';
4
9
  import { encodePointer } from '../../math/abi';