-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/live 15799 alpaca tron combine #9381
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR introduces a new combine function for Alpaca, revamps the broadcast functionality to use a custom transaction and signature serialization, and reorganizes utility functions to a more appropriate subdirectory. In addition, integration tests (using dotenv for local secret management) and updates to coin configuration for Tron (and Tezos) modules are provided.
- Added the combine function and corresponding unit tests.
- Updated broadcast implementations to align with the new API behavior.
- Refactored configuration and utilities import paths across multiple modules.
Reviewed Changes
File | Description |
---|---|
libs/coin-modules/coin-tron/src/bridge/utils.test.ts | Added tests for txInfoToOperation. |
libs/coin-modules/coin-tron/src/api/index.integ.test.ts | Integrated tests for combine and broadcast functions using TronWeb. |
libs/coin-modules/coin-tron/src/bridge/utils.ts | Moved and updated utility functions with a note on duplication. |
libs/coin-modules/coin-tron/src/logic/combine.test.ts | Added unit tests for the combine function and decodeTransaction routine. |
libs/coin-modules/coin-tron/src/api/index.ts | Created API export using the new combine, broadcast, and craftTransaction functions. |
libs/coin-modules/coin-tron/src/logic/craftTransaction.ts | Introduced a stub for the craftTransaction function. |
libs/coin-modules/coin-tron/src/logic/broadcast.ts | Revamped broadcast functionality; removed explicit error-check on broadcast result. |
libs/coin-modules/coin-tron/src/bridge/broadcast.ts | Updated broadcast bridge to remove result validation previously handled. |
libs/coin-modules/coin-tron/src/config.ts | Refactored coin configuration to use buildCoinConfig for consistency. |
libs/coin-modules/coin-tezos/src/config.ts | Updated to use buildCoinConfig to align with Tron configuration module. |
libs/coin-modules/coin-tron/src/bridge/synchronization.ts | Adjusted synchronization logic with updated utils imports. |
libs/coin-modules/coin-tron/src/bridge/getEstimateFees.ts | Changed import paths to use local utils, reflecting a restructuring of code. |
libs/coin-modules/coin-tron/src/bridge/index.ts | Updated bridge setup to use the new coin configuration setter from tronCoinConfig. |
libs/coin-modules/coin-tron/src/bridge/buildOptimisticOperation.ts | Altered import path for getOperationTypefromMode to align with the new utils location. |
libs/coin-modules/coin-tron/jest.integ.config.js | Added dotenv setup to support environment-dependent integration tests. |
Copilot reviewed 33 out of 33 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (2)
libs/coin-modules/coin-tron/src/logic/broadcast.ts:16
- The removal of the error check for the broadcastTron result means that failures might go unnoticed. Consider reintroducing error handling to verify that the broadcast was successful.
await broadcastTron(transaction);
libs/coin-modules/coin-tron/src/api/index.integ.test.ts:71
- [nitpick] Using non-null assertions on 'signature' may hide potential cases where the signature is missing, potentially causing runtime errors. It is advisable to perform an explicit check before accessing the signature.
signedTrx!.signature![0] as unknown as string,
await broadcastTron(transaction); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the check for a successful broadcast (i.e., verifying the result of broadcastTron) could lead to silent failures. It is recommended to handle error responses appropriately.
await broadcastTron(transaction); | |
try { | |
await broadcastTron(transaction); | |
} catch (error) { | |
console.error("Failed to broadcast transaction:", error); | |
throw error; | |
} |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
e782a44
to
ec423af
Compare
Signed-off-by: Stéphane Prohaszka <[email protected]>
Signed-off-by: Stéphane Prohaszka <[email protected]>
Signed-off-by: Stéphane Prohaszka <[email protected]>
Signed-off-by: Stéphane Prohaszka <[email protected]>
Signed-off-by: Stéphane Prohaszka <[email protected]>
ec423af
to
e47978b
Compare
|
✅ Checklist
npx changeset
was attached.📝 Description
Add
combine
function for Alpaca.Revamp
broadcast
function to use custom tx+signature serialization, in order to keep the same Alpaca API.Move some "utils" functions to be closer to the correct subdir.
Add integration tests to "Api" with use of dotenv to keep secret private key. This feature is for local test only, not CI.
❓ Context
🧐 Checklist for the PR Reviewers