@btc-vision/btc-runtime 1.9.5 → 1.9.7
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
|
@@ -619,7 +619,7 @@ export abstract class OP721 extends ReentrancyGuard implements IOP721 {
|
|
|
619
619
|
protected _setTokenURI(tokenId: u256, uri: string): void {
|
|
620
620
|
if (!this._exists(tokenId)) throw new Revert('Token does not exist');
|
|
621
621
|
|
|
622
|
-
if (uri.length > MAX_URI_LENGTH) {
|
|
622
|
+
if (<u32>uri.length > MAX_URI_LENGTH) {
|
|
623
623
|
throw new Revert('URI exceeds maximum length');
|
|
624
624
|
}
|
|
625
625
|
|
|
@@ -780,6 +780,7 @@ export abstract class OP721 extends ReentrancyGuard implements IOP721 {
|
|
|
780
780
|
const newIndex = tokenArray.getLength();
|
|
781
781
|
tokenArray.push(tokenId);
|
|
782
782
|
this.tokenIndexMap.set(tokenId, u256.fromU32(newIndex));
|
|
783
|
+
tokenArray.save();
|
|
783
784
|
}
|
|
784
785
|
|
|
785
786
|
protected _removeTokenFromOwnerEnumeration(from: Address, tokenId: u256): void {
|
|
@@ -804,6 +805,8 @@ export abstract class OP721 extends ReentrancyGuard implements IOP721 {
|
|
|
804
805
|
// Remove last element
|
|
805
806
|
tokenArray.deleteLast();
|
|
806
807
|
this.tokenIndexMap.delete(tokenId);
|
|
808
|
+
|
|
809
|
+
tokenArray.save();
|
|
807
810
|
}
|
|
808
811
|
|
|
809
812
|
/**
|
|
@@ -9,7 +9,7 @@ export const MAX_URI_LENGTH: u32 = 200;
|
|
|
9
9
|
@final
|
|
10
10
|
export class URIEvent extends NetEvent {
|
|
11
11
|
constructor(value: string, id: u256) {
|
|
12
|
-
const valueBytes:
|
|
12
|
+
const valueBytes: u32 = u32(String.UTF8.byteLength(value));
|
|
13
13
|
|
|
14
14
|
if (valueBytes > MAX_URI_LENGTH) {
|
|
15
15
|
throw new Revert('URI event exceeds max data size');
|