-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor(tangle-dapp): Integrate bridge ERC-20 tokens into restaking #2783
base: develop
Are you sure you want to change the base?
Conversation
β Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for tangle-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
β Deploy Preview for tangle-cloud ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Progress:
|
@yurixander I was able to bridge CleanShot.2025-02-01.at.12.23.24.mp4As we discussed, these issues need to be addressed:
Otherwise, LGTM! |
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.
Left some comments.
@@ -45,7 +45,7 @@ export default function usePayouts(): UsePayoutsReturnType { | |||
LocalStorageKey.PAYOUTS, | |||
); | |||
|
|||
const { rpcEndpoint, network } = useNetworkStore(); |
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.
Why don't we use the selector here?
const wsRpcEndpoint = useNetworkStore(store => store.network.wsRpcEndpoint);
}), | ||
); | ||
return Object.entries(delegatorInfo.deposits).map(([assetIdString]) => { | ||
const availableForWithdrawal = calculateRestakeAvailableBalance( |
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.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
(delegation) => delegation.assetId === selectedAsset.id, | ||
)?.amountBonded ?? ZERO_BIG_INT; | ||
|
||
const availableBalance = amountBigInt - delegatedBigInt; |
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.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
(delegation) => delegation.assetId === assetId, | ||
)?.amountBonded ?? ZERO_BIG_INT; | ||
|
||
const balance = new BN((amount - delegatedAmount).toString()); |
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.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
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.
@AtelyPham I tested with these calculations, and everything seems to be in order, including after you deposit, delegate, withdraw, etc. all the values updated accordingly. Just to make sure, that's the same case for when you used delegated_amount
?
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.
^ Also these tests were done with local dev on latest Tangle node changes, since testnet has different / incorrect values which seem to have been fixed on newer node updates.
return {}; | ||
} | ||
|
||
const depositedAsset = Object.entries(delegatorInfo.deposits).find( | ||
([assetId]) => assetId === selectedAssetId, | ||
const availableBalance = calculateRestakeAvailableBalance( |
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.
The backend has a field called delegated_amount
that indicates the total delegated amount, which can be used to calculate the available balance.
This issue has been addressed in PR #2788.
Conflicts here |
Summary of changes
Provide a detailed description of proposed changes.
Proposed area of change
Put an
x
in the boxes that apply.apps/tangle-dapp
apps/tangle-cloud
libs/tangle-shared-ui
libs/webb-ui-components
Associated issue(s)
Specify any issues that can be closed from these changes (e.g.
Closes #233
).Screen Recording
If possible provide screenshots and/or a screen recording of proposed change.