Skip to content

Commit

Permalink
fix missing try catch (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
seaona authored Mar 1, 2024
1 parent 21b20a8 commit 2395faa
Showing 1 changed file with 34 additions and 26 deletions.
60 changes: 34 additions & 26 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2926,19 +2926,23 @@ const initializeFormElements = () => {
*/
sendEIP1559Batch.onclick = async () => {
for (let i = 0; i < 10; i++) {
provider.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
value: '0x0',
gasLimit: '0x5028',
maxFeePerGas: '0x2540be400',
maxPriorityFeePerGas: '0x3b9aca00',
},
],
});
try {
provider.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: '0x5FbDB2315678afecb367f032d93F642f64180aa3',
value: '0x0',
gasLimit: '0x5028',
maxFeePerGas: '0x2540be400',
maxPriorityFeePerGas: '0x3b9aca00',
},
],
});
} catch (err) {
console.error(err);
}
}
};

Expand All @@ -2947,19 +2951,23 @@ const initializeFormElements = () => {
*/
sendEIP1559Queue.onclick = async () => {
for (let i = 0; i < 10; i++) {
await provider.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: '0x0c54FcCd2e384b4BB6f2E405Bf5Cbc15a017AaFb',
value: '0x0',
gasLimit: '0x5028',
maxFeePerGas: '0x2540be400',
maxPriorityFeePerGas: '0x3b9aca00',
},
],
});
try {
await provider.request({
method: 'eth_sendTransaction',
params: [
{
from: accounts[0],
to: '0x0c54FcCd2e384b4BB6f2E405Bf5Cbc15a017AaFb',
value: '0x0',
gasLimit: '0x5028',
maxFeePerGas: '0x2540be400',
maxPriorityFeePerGas: '0x3b9aca00',
},
],
});
} catch (err) {
console.error(err);
}
}
};

Expand Down

0 comments on commit 2395faa

Please sign in to comment.