@mysten/sui 1.37.3 → 1.37.5
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/CHANGELOG.md +12 -0
- package/dist/cjs/transactions/Transaction.js +30 -27
- package/dist/cjs/transactions/Transaction.js.map +2 -2
- package/dist/cjs/transactions/executor/parallel.js +3 -2
- package/dist/cjs/transactions/executor/parallel.js.map +2 -2
- package/dist/cjs/version.d.ts +2 -2
- package/dist/cjs/version.js +2 -2
- package/dist/cjs/version.js.map +1 -1
- package/dist/esm/transactions/Transaction.js +30 -27
- package/dist/esm/transactions/Transaction.js.map +2 -2
- package/dist/esm/transactions/executor/parallel.js +3 -2
- package/dist/esm/transactions/executor/parallel.js.map +2 -2
- package/dist/esm/version.d.ts +2 -2
- package/dist/esm/version.js +2 -2
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/transactions/Transaction.ts +30 -28
- package/src/transactions/executor/parallel.ts +3 -2
- package/src/version.ts +2 -2
package/package.json
CHANGED
|
@@ -752,43 +752,45 @@ export class Transaction {
|
|
|
752
752
|
}
|
|
753
753
|
|
|
754
754
|
async #runPlugins(plugins: TransactionPlugin[], options: SerializeTransactionOptions) {
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
755
|
+
try {
|
|
756
|
+
const createNext = (i: number) => {
|
|
757
|
+
if (i >= plugins.length) {
|
|
758
|
+
return () => {};
|
|
759
|
+
}
|
|
760
|
+
const plugin = plugins[i];
|
|
760
761
|
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
762
|
+
return async () => {
|
|
763
|
+
const next = createNext(i + 1);
|
|
764
|
+
let calledNext = false;
|
|
765
|
+
let nextResolved = false;
|
|
765
766
|
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
767
|
+
await plugin(this.#data, options, async () => {
|
|
768
|
+
if (calledNext) {
|
|
769
|
+
throw new Error(`next() was call multiple times in TransactionPlugin ${i}`);
|
|
770
|
+
}
|
|
770
771
|
|
|
771
|
-
|
|
772
|
+
calledNext = true;
|
|
772
773
|
|
|
773
|
-
|
|
774
|
+
await next();
|
|
774
775
|
|
|
775
|
-
|
|
776
|
-
|
|
776
|
+
nextResolved = true;
|
|
777
|
+
});
|
|
777
778
|
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
779
|
+
if (!calledNext) {
|
|
780
|
+
throw new Error(`next() was not called in TransactionPlugin ${i}`);
|
|
781
|
+
}
|
|
781
782
|
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
783
|
+
if (!nextResolved) {
|
|
784
|
+
throw new Error(`next() was not awaited in TransactionPlugin ${i}`);
|
|
785
|
+
}
|
|
786
|
+
};
|
|
785
787
|
};
|
|
786
|
-
};
|
|
787
|
-
|
|
788
|
-
await createNext(0)();
|
|
789
788
|
|
|
790
|
-
|
|
791
|
-
|
|
789
|
+
await createNext(0)();
|
|
790
|
+
} finally {
|
|
791
|
+
this.#inputSection = this.#data.inputs.slice();
|
|
792
|
+
this.#commandSection = this.#data.commands.slice();
|
|
793
|
+
}
|
|
792
794
|
}
|
|
793
795
|
|
|
794
796
|
async #waitForPendingTasks() {
|
|
@@ -242,6 +242,7 @@ export class ParallelTransactionExecutor {
|
|
|
242
242
|
BigInt(gasUsed.storageCost) +
|
|
243
243
|
BigInt(gasUsed.storageCost) -
|
|
244
244
|
BigInt(gasUsed.storageRebate);
|
|
245
|
+
const remainingBalance = gasCoin.balance - totalUsed;
|
|
245
246
|
|
|
246
247
|
let usesGasCoin = false;
|
|
247
248
|
new TransactionDataBuilder(transaction.getData()).mapArguments((arg) => {
|
|
@@ -252,12 +253,12 @@ export class ParallelTransactionExecutor {
|
|
|
252
253
|
return arg;
|
|
253
254
|
});
|
|
254
255
|
|
|
255
|
-
if (!usesGasCoin &&
|
|
256
|
+
if (!usesGasCoin && remainingBalance >= this.#minimumCoinBalance) {
|
|
256
257
|
this.#coinPool.push({
|
|
257
258
|
id: gasResult.ref.objectId,
|
|
258
259
|
version: gasResult.ref.version,
|
|
259
260
|
digest: gasResult.ref.digest,
|
|
260
|
-
balance:
|
|
261
|
+
balance: remainingBalance,
|
|
261
262
|
});
|
|
262
263
|
} else {
|
|
263
264
|
if (!this.#sourceCoins) {
|
package/src/version.ts
CHANGED