Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Substrate tx-queue tracking and http endpoints for processing withdraw tx#551

Merged
shekohex merged 14 commits intodevelopfrom
salman/update-substrate-tx-queue
Jul 4, 2023
Merged

Substrate tx-queue tracking and http endpoints for processing withdraw tx#551
shekohex merged 14 commits intodevelopfrom
salman/update-substrate-tx-queue

Conversation

@salman01zp
Copy link
Copy Markdown
Contributor

@salman01zp salman01zp commented Jul 3, 2023

Summary of changes

  • Convert ws endpoint into HTTP POST endpoint for substrate chains.
  • Add transaction queue item tracking endpoint for substrate chains
  • Update tests for evm

Send Withdraw request API

/api/v1/send/substrate/:chainId/:treeId

Withdraw request Payload

{
  "chainId": 1081,
  "id": 1,
  "extData": {
    "recipient": "0x306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20",
    "relayer": "0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22",
    "extAmount": "-32e976941b78c4647a",
    "fee": "0x00000000000000034c5319aa65db9b86",
    "refund": "0x00000000000000000000000000000000",
    "token": 0,
    "encryptedOutput1": "0x20ac8d0c525f0f38a7f54890e6e9efc51949acd24be2f9bce8021b3420bbf3b552c3bd9881b885e8b266a6d80150f042c013aef7d3a00567f10eae7940fc813971bd7527c838f519825aacbd3e4cf1535ebf20faedc30d2df88bb12bea68a42bfe516798cb6d2bc87da205111430891355ca03304ecc279a0314e16fe3992c1242049ec7273f4b9386daeb8a1a8bd8efade06fb182c43b0865df5ad8869fecbc438c8e79b71c262d",
    "encryptedOutput2": "0x3ab0300b1b916f658e9b9e1ae94c39010938c614441e2b8dfed82f86f3aa9b67de0934dd728ee3b3e2a8da44bcba4422ee40ce806eafa96e6d2f788e30e4679006b4eb32e0263f30c56446d5786c3e9fb959025a8561e6921fa647ec18f94e05c6c62e32bcb84638a9cc6c082a7eb68518c00bfbf6bc7d0c46d48b959f0bdaa250959e29216e548b496b5dc3e7e64a3cd3c6f08e0aaae62571d4e02c959b9b826b015a58555d6f92"
  },
  "proofData": {
    "proof": "0x1c8e13a68020315f78b840e640d6e8bb2a57882429b77ff0bc1539e335734cf4019f5690e7c9b7f780eaf17e75f757cb11b4375a48a4852ed444047f16aa89cd2bcf164a0c89239ed783ade65ac6a4eda9dcefdc3082d7a096618aaec7f8d6a319a4daa5b0c991f845c016f50ad138b306e684b4a1f77ae3d4673c65b868cd942e6b7c2f3506ecba79af915c443c43042dad170f138a3c1bed0e42cb5bc9e3a908e8a8a3f00a2c85793e215558975c2090a790f4b8f08fdc633c40491943daae0fd6b880b13c4a14180a0b2c07d7c936698ee11ea0cbd322f79d30b78bf8997010efaa91a7c77b3ee80308f61f1300cbc67e8f3eaa45bc4a48b3708ed6c28029",
    "extDataHash": "0x043ccb419ad424d5aa01402e1daf405dc1b0c6f4d781e0b980736659a9f8873b",
    "publicAmount": "0x30644e72e131a029b85045b68181585d2833e84879b9705b0e1847ce11600001",
    "roots": [
      "0x068c0debe71805405e24df1df4b04ff519bf7959dc3730df4af230387c870401",
      "0x23ab323453748129f2765f79615022f5bebd6f4096a796300aab049a60b0f187"
    ],
    "extensionRoots": [
      
    ],
    "outputCommitments": [
      "0x1a80b56e8359396e24071c82113641b868f620f0496529075448f099cec66a35",
      "0x0c9ab9d8473a29f818ba5afef1928d15a9260d9f3c082335748e0ab1bd223e6a"
    ],
    "inputNullifiers": [
      "0x009c064728628411d961241affd2627378293827980cb5805ae9296ce544e9ee",
      "0x10c028de0005d96023cd678c9d5691346b4476d28fb4cc5d5051ad1f1778bf17"
    ]
  }
}

WithdrawTxSuccessResponse

{
  "status": "Sent",
  "message": "Transaction sent successfully",
  "itemKey": "0x7375627374726174655f7472616e73616374696f6e5f6974656d5f6b65795f5fe29b0a0f4ec085a6fb613e3ea81edd24032bdd6881ab4eadbe7cbded381358ac"
}

2. Track transaction progress API

API

/api/v1/tx/substrate/:chainId:/:itemKey

Response

{ "status": "Pending", "itemKey": "0x7375…58ac" }

Reference issue to close (if applicable)


Code Checklist

  • Tested
  • Documented

@drewstone
Copy link
Copy Markdown
Contributor

What's the status of this? If this can't be done by tomorrow I'd say we table it.

@shekohex
Copy link
Copy Markdown
Collaborator

shekohex commented Jul 4, 2023

Could you please remove the ws endpoint too, and everything related to it? It is not needed anymore.

@salman01zp salman01zp marked this pull request as ready for review July 4, 2023 09:52
@salman01zp salman01zp requested a review from shekohex as a code owner July 4, 2023 09:52
@shekohex shekohex merged commit 9449b03 into develop Jul 4, 2023
@shekohex shekohex deleted the salman/update-substrate-tx-queue branch July 4, 2023 10:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TASK] Expose HTTP GET API for inspecting the status of a transaction in the TxQueue

3 participants