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(core, apps): 'PacketDataProvider' interface added and implemented #4199

Merged
merged 18 commits into from
Aug 1, 2023

Conversation

srdtrk
Copy link
Member

@srdtrk srdtrk commented Jul 28, 2023

Description

This PR reduces the diff when reviewing the adr8 PR #3939.

PacketDataProvider defines an optional interfaces for retrieving custom packet data stored on behalf of another application.

closes: #XXXX

Commit Message / Changelog Entry

feat(core, apps): 'PacketDataProvider' interface added and implemented

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

modules/core/exported/packet.go Outdated Show resolved Hide resolved
modules/apps/27-interchain-accounts/types/packet_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

LGTM! Will take another quick peak after the cast removal change is added

modules/core/exported/packet.go Outdated Show resolved Hide resolved
modules/apps/transfer/types/packet.go Outdated Show resolved Hide resolved
modules/apps/transfer/types/packet.go Outdated Show resolved Hide resolved
modules/apps/transfer/types/packet_test.go Outdated Show resolved Hide resolved
testCases := []struct {
name string
packetData types.FungibleTokenPacketData
expAdditionalData map[string]interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

can also maybe call expCustomData?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@codecov-commenter
Copy link

Codecov Report

Merging #4199 (fbcf8b7) into main (4e1e594) will increase coverage by 0.01%.
Report is 9 commits behind head on main.
The diff coverage is 75.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4199      +/-   ##
==========================================
+ Coverage   79.45%   79.47%   +0.01%     
==========================================
  Files         188      188              
  Lines       12990    13025      +35     
==========================================
+ Hits        10321    10351      +30     
- Misses       2240     2243       +3     
- Partials      429      431       +2     
Files Changed Coverage Δ
...interchain-accounts/controller/keeper/handshake.go 89.85% <ø> (ø)
...les/apps/27-interchain-accounts/host/ibc_module.go 91.11% <ø> (ø)
...ps/27-interchain-accounts/host/keeper/handshake.go 89.39% <ø> (ø)
...odules/core/02-client/migrations/v7/solomachine.go 18.30% <0.00%> (ø)
modules/core/02-client/types/proposal.go 87.01% <0.00%> (ø)
modules/core/03-connection/types/codec.go 100.00% <ø> (ø)
modules/core/03-connection/types/connection.go 76.81% <0.00%> (ø)
modules/core/23-commitment/types/merkle.go 68.04% <0.00%> (ø)
modules/core/24-host/parse.go 51.47% <30.00%> (-2.63%) ⬇️
...dules/light-clients/06-solomachine/client_state.go 88.28% <33.33%> (ø)
... and 37 more

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Beautiful! Thank you! Only left a comment on a nit because of naming consistency

testCases := []struct {
name string
packetData types.FungibleTokenPacketData
expAdditionalData interface{}
Copy link
Contributor

Choose a reason for hiding this comment

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

super super nit: expAdditionalData -> expCustomData

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@srdtrk srdtrk merged commit a0a6526 into main Aug 1, 2023
53 checks passed
@srdtrk srdtrk deleted the serdar/packetdataprovider branch August 1, 2023 16:18
mergify bot pushed a commit that referenced this pull request Aug 1, 2023
#4199)

* refactor(core/exported): moved packet interfaces to packet.go

* feat(core/exported): 'PacketDataProvider' interface added

* feat(transfer): PacketDataProvider implemented

* feat(ica): implemented PacketDataProvider

* style(transfer_test, ica_test): improved test name

* docs(core.adr8): updated godocs

* style(ica_test): changed a variable name

* docs(core.adr8): added missing '.'

* imp(transfer): removed type assertion on jsonKey

* fix(transfer_test): removed unused test case parameter

* docs(transfer): updated godocs

* imp(ica): removed type assertion from 'GetCustomPacketData'

* imp(transfer_test): improved tests without type assertion

* imp(ica_test): improved tests without type assertion

* style(transfer_test): changed test case parameter name

(cherry picked from commit a0a6526)

# Conflicts:
#	modules/apps/27-interchain-accounts/types/packet.go
#	modules/apps/transfer/types/packet.go
#	modules/core/exported/channel.go
srdtrk added a commit that referenced this pull request Aug 2, 2023
…d (backport #4199) (#4218)

* feat(core, apps): 'PacketDataProvider' interface added and implemented (#4199)

* refactor(core/exported): moved packet interfaces to packet.go

* feat(core/exported): 'PacketDataProvider' interface added

* feat(transfer): PacketDataProvider implemented

* feat(ica): implemented PacketDataProvider

* style(transfer_test, ica_test): improved test name

* docs(core.adr8): updated godocs

* style(ica_test): changed a variable name

* docs(core.adr8): added missing '.'

* imp(transfer): removed type assertion on jsonKey

* fix(transfer_test): removed unused test case parameter

* docs(transfer): updated godocs

* imp(ica): removed type assertion from 'GetCustomPacketData'

* imp(transfer_test): improved tests without type assertion

* imp(ica_test): improved tests without type assertion

* style(transfer_test): changed test case parameter name

(cherry picked from commit a0a6526)

# Conflicts:
#	modules/apps/27-interchain-accounts/types/packet.go
#	modules/apps/transfer/types/packet.go
#	modules/core/exported/channel.go

* fix: fixed backport conflicts

* style: ran gofumpt

* style(ica_test): typo fixed

---------

Co-authored-by: srdtrk <[email protected]>
Co-authored-by: srdtrk <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants