-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into mc/chore/upgrade-fuel-core
- Loading branch information
Showing
128 changed files
with
1,734 additions
and
1,130 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/contract": patch | ||
"@fuel-ts/account": patch | ||
--- | ||
|
||
chore: deprecate `BaseTransactionRequest.fundWithFakeUtxos` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/contract": patch | ||
"@fuel-ts/account": patch | ||
--- | ||
|
||
feat: validate blob IDs against chain in chunk deploys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
--- | ||
|
||
chore: add e2e tests for transaction summary operations |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
--- | ||
|
||
chore: adding type checking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/account": patch | ||
"@fuel-ts/errors": patch | ||
--- | ||
|
||
feat: map 'not enough coins' error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-fuels": patch | ||
--- | ||
|
||
build(deps): bump the deps-patch group with 9 updates |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@fuel-ts/account": patch | ||
--- | ||
|
||
feat: support basic auth |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@fuel-ts/crypto": patch | ||
"@fuel-ts/errors": patch | ||
--- | ||
|
||
chore: removed redundant crypto functionality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
apps/docs-snippets/src/guide/cookbook/resubmitting-failed-transactions.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import { bn, type FuelError } from 'fuels'; | ||
import { launchTestNode } from 'fuels/test-utils'; | ||
|
||
/** | ||
* @group node | ||
* @group browser | ||
*/ | ||
describe('Resubmitting Failed Transactions', () => { | ||
it('should submit transaction just fine', async () => { | ||
const { | ||
provider, | ||
wallets: [wallet, recipient], | ||
} = await launchTestNode({ | ||
walletsConfig: { | ||
count: 2, | ||
}, | ||
}); | ||
const baseAssetId = provider.getBaseAssetId(); | ||
|
||
const transferAmount = 1000; | ||
|
||
// #region resubmitting-failed-transactions-1 | ||
const transactionRequest = await wallet.createTransfer( | ||
recipient.address, | ||
transferAmount, | ||
baseAssetId | ||
); | ||
|
||
const response = await wallet.sendTransaction(transactionRequest); | ||
// #endregion resubmitting-failed-transactions-1 | ||
|
||
// #region resubmitting-failed-transactions-2 | ||
const result = await response.waitForResult(); | ||
// #endregion resubmitting-failed-transactions-2 | ||
|
||
expect(result.isStatusSuccess).toBeTruthy(); | ||
}); | ||
|
||
it('should try to re-submit the transaction', async () => { | ||
const { | ||
provider, | ||
wallets: [wallet, recipient], | ||
} = await launchTestNode({ | ||
walletsConfig: { | ||
count: 2, | ||
}, | ||
}); | ||
const baseAssetId = provider.getBaseAssetId(); | ||
const transferAmount = 1000; | ||
|
||
await expect(async () => { | ||
// #region resubmitting-failed-transactions-3 | ||
const transactionRequest = await wallet.createTransfer( | ||
recipient.address, | ||
transferAmount, | ||
baseAssetId | ||
); | ||
|
||
// Set the gasLimit to 0 to force revert with OutOfGas error | ||
transactionRequest.gasLimit = bn(0); | ||
|
||
// Transaction will be successfully submitted | ||
const response = await wallet.sendTransaction(transactionRequest); | ||
try { | ||
await response.waitForResult(); | ||
} catch (error) { | ||
if (/OutOfGas/.test((<FuelError>error).message)) { | ||
transactionRequest.gasLimit = bn(1000); | ||
// Re-submission will fail | ||
await wallet.sendTransaction(transactionRequest); | ||
} | ||
} | ||
// #endregion resubmitting-failed-transactions-3 | ||
}).rejects.toThrow('Transaction is not inserted. UTXO does not exist: 0x'); | ||
|
||
await expect( | ||
(async () => { | ||
const transactionRequest = await wallet.createTransfer( | ||
recipient.address, | ||
transferAmount, | ||
baseAssetId | ||
); | ||
|
||
transactionRequest.gasLimit = bn(0); | ||
|
||
const response = await wallet.sendTransaction(transactionRequest); | ||
// #region resubmitting-failed-transactions-4 | ||
try { | ||
await response.waitForResult(); | ||
} catch (error) { | ||
if (/OutOfGas/.test((<FuelError>error).message)) { | ||
const transactionRequest2 = await wallet.createTransfer( | ||
recipient.address, | ||
transferAmount, | ||
baseAssetId | ||
); | ||
|
||
await wallet.sendTransaction(transactionRequest2); | ||
} | ||
} | ||
// #endregion resubmitting-failed-transactions-4 | ||
})() | ||
).resolves.not.toThrow(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.