Skip to content

Commit 7bbb5e4

Browse files
committed
adjust call
1 parent 0bc94d4 commit 7bbb5e4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

packages/sdk/src/mintlayer-connect-sdk.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,24 +2597,25 @@ class Client {
25972597
apply: async (target, thisArg, args) => {
25982598
// Call the original function
25992599
const result = Reflect.apply(target, thisArg, args);
2600-
console.log('result', result);
26012600
txresult = await result;
26022601
// Return the result of the function call
26032602
return result;
26042603
},
26052604
})
26062605

2607-
const t= await func()
2608-
2609-
if(!txresult){
2610-
throw new Error('Failed to decorate with UtxoFetch');
2611-
}
2606+
try {
2607+
const t = await func()
26122608

2613-
const { created, spent } = this.previewUtxoChange(txresult);
2609+
if (!txresult) {
2610+
throw new Error('Failed to decorate with UtxoFetch');
2611+
}
26142612

2615-
this.buildTransaction = originalBuildTransaction;
2613+
const { created, spent } = this.previewUtxoChange(txresult);
26162614

2617-
return { result: t, utxo: { created, spent } };
2615+
return { result: t, utxo: { created, spent } };
2616+
} finally {
2617+
this.buildTransaction = originalBuildTransaction;
2618+
}
26182619
}
26192620

26202621
async getAccountOrders(): Promise<OrderData[]> {

0 commit comments

Comments
 (0)