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

Store IBC trace when minting #3319

Merged
merged 4 commits into from
May 31, 2024
Merged

Store IBC trace when minting #3319

merged 4 commits into from
May 31, 2024

Conversation

yito88
Copy link
Member

@yito88 yito88 commented May 27, 2024

Describe your changes

closes #3317, closes #3229
Also,

  • Remove get_ibc_events and IBC event conversion functions
  • Fix is_receiving_success without checking events

Indicate on which release or other PRs this topic is based on

v0.37.0

Checklist before merging to draft

  • I have added a changelog
  • Git history is in acceptable state

@yito88 yito88 requested a review from sug0 May 27, 2024 20:26
Copy link

codecov bot commented May 27, 2024

Codecov Report

Attention: Patch coverage is 71.18644% with 17 lines in your changes are missing coverage. Please review.

Project coverage is 53.71%. Comparing base (6dc1612) to head (bc40dd2).
Report is 2 commits behind head on main.

Files Patch % Lines
crates/ibc/src/lib.rs 0.00% 16 Missing ⚠️
crates/ibc/src/context/token_transfer.rs 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3319      +/-   ##
==========================================
- Coverage   53.89%   53.71%   -0.18%     
==========================================
  Files         314      314              
  Lines      105704   105561     -143     
==========================================
- Hits        56968    56702     -266     
- Misses      48736    48859     +123     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cwgoes cwgoes mentioned this pull request May 28, 2024
sug0
sug0 previously approved these changes May 29, 2024
Copy link
Contributor

@sug0 sug0 left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines -184 to -199
impl TryFrom<Event> for IbcEvent {
type Error = EventError;

fn try_from(namada_event: Event) -> std::result::Result<Self, Self::Error> {
Ok(Self {
event_type: validate_ibc_event_type(&namada_event)?,
attributes: {
let mut attrs: HashMap<_, _> =
namada_event.into_attributes().into_iter().collect();
attrs.with_attribute(event_domain_of::<Self>());
attrs
},
})
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this could have still been useful, but not to the ledger codebase directly. it could be useful as sdk library code for users to consume. maybe this can be restored in the future, with proper event type validation

cwgoes
cwgoes previously approved these changes May 29, 2024
Copy link
Contributor

@cwgoes cwgoes left a comment

Choose a reason for hiding this comment

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

ACK modulo nit

owner: &Address,
coin: &PrefixedCoin,
) -> Result<(), TokenTransferError> {
if coin.denom.trace_path.is_empty() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would we call the function in this case, though? If we must do it like this, we should call the function maybe_store_ibc_denom or something, since it sometimes doesn't store anything at all.

@yito88 yito88 dismissed stale reviews from cwgoes and sug0 via bc40dd2 May 29, 2024 15:07
brentstone added a commit that referenced this pull request May 29, 2024
* yuji/store-ibc-trace:
  fix func name
  add changelog
  new is_receiving_success
  store ibc traces when minting
brentstone added a commit that referenced this pull request May 30, 2024
* origin/yuji/store-ibc-trace:
  fix func name
  add changelog
  new is_receiving_success
  store ibc traces when minting
@brentstone brentstone merged commit 787162a into main May 31, 2024
17 of 19 checks passed
@brentstone brentstone deleted the yuji/store-ibc-trace branch May 31, 2024 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Store IBC denom when minting the IBC token Validate IBC event types
4 participants