Skip to content

Commit c7a824f

Browse files
authored
Merge pull request #1 from weaveVM/handle-multiple-txs-ids
feat: Handle multiple txs
2 parents 84c4196 + 8cef8bf commit c7a824f

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

.idea/.gitignore

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/lambda.iml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sequencer/server.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,17 @@ app.post("/transactions", async (req, res) => {
7575
// auto tx handler, type agnostic (handles both type 1 and 2)
7676
app.post("/tx", async (req, res) => {
7777
try {
78-
const { txid } = req.body;
79-
80-
const tx = await handleTx(txid);
81-
82-
res.send(tx);
78+
const { txid, bulk, txs } = req.body;
79+
80+
// TODO: Handle dissapointments
81+
if(bulk) {
82+
const all = txs.map((tx) => handleTx(tx));
83+
const wait = await Promise.allSettled(all);
84+
res.send({ result: wait.status === "fulfilled" });
85+
} else {
86+
const tx = await handleTx(txid);
87+
res.send(tx);
88+
}
8389
} catch (error) {
8490
console.log(error);
8591
return {result: false}

sequencer/utils/web3-utils.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)