Skip to content
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(tendermint): unstaking/undelegation #2330

Merged
merged 12 commits into from
Feb 7, 2025
Merged

feat(tendermint): unstaking/undelegation #2330

merged 12 commits into from
Feb 7, 2025

Conversation

onur-ozkan
Copy link
Member

@onur-ozkan onur-ozkan commented Jan 29, 2025

Adds tendermint protocol support on remove_delegation RPC, and extends tendermint transaction history implementation to support undelegate transactions.

Next is to add staking listing RPCs for delegations, undelegations (with claiming period informations), rewards, etc.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan changed the title feat(cosmos): unstaking feat(tendermint): unstaking/undelegation Jan 30, 2025
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Copy link
Member

@borngraced borngraced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! very minor changes.

mm2src/coins/tendermint/tendermint_coin.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_tx_history_v2.rs Outdated Show resolved Hide resolved
mm2src/coins/tendermint/tendermint_tx_history_v2.rs Outdated Show resolved Hide resolved
Signed-off-by: onur-ozkan <work@onurozkan.dev>
borngraced

This comment was marked as off-topic.

borngraced
borngraced previously approved these changes Feb 6, 2025
Copy link
Member

@borngraced borngraced left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 🚀

@@ -38,6 +38,7 @@ const IBC_SEND_EVENT: &str = "ibc_transfer";
const IBC_RECEIVE_EVENT: &str = "fungible_token_packet";
const IBC_NFT_RECEIVE_EVENT: &str = "non_fungible_token_packet";
const DELEGATE_EVENT: &str = "delegate";
const UNDELEGATE_EVENT: &str = "unbond";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a typo by a chance (not 'unbound')?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Copy link
Collaborator

@dimxy dimxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shamardy
Copy link
Collaborator

shamardy commented Feb 7, 2025

@onur-ozkan please open docs issue for this change.

Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Only one non-blocker comment for the future.

Comment on lines +4882 to +4886
if req.withdraw_from.is_some() {
return MmError::err(DelegationError::InvalidPayload {
reason: "Can't use `withdraw_from` field on 'remove_delegation' RPC for Cosmos.".to_owned(),
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non blocker but for docs and maybe future implementations. We should support HD wallet for all delegate/undelegate/etc.. operations. For now such mention in docs that this is done for the enabled address only.

@shamardy shamardy merged commit 25503b1 into dev Feb 7, 2025
19 of 25 checks passed
@shamardy shamardy deleted the cosmos-unstake branch February 7, 2025 09:27
shamardy pushed a commit that referenced this pull request Feb 7, 2025
Adds tendermint protocol support on remove_delegation RPC, and extends tendermint transaction history implementation to support undelegate transactions.
@onur-ozkan
Copy link
Member Author

@onur-ozkan please open docs issue for this change.

I will once we consider whole staking functionality is implemented. I didn't do this yet as things can change a little bit while implementing remaining parts.

dimxy added a commit that referenced this pull request Feb 11, 2025
* dev:
  fix(tpu-v2): fix tpu-v2 wait for payment spend and extract secret (#2261)
  feat(tendermint): unstaking/undelegation (#2330)
  fix(utxo-withdraw): get hw ctx only when `PrivKeyPolicy` is trezor (#2333)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants