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: add the custom handlers for cosmwasm #1997

Merged
merged 30 commits into from
May 25, 2023
Merged

feat: add the custom handlers for cosmwasm #1997

merged 30 commits into from
May 25, 2023

Conversation

gsk967
Copy link
Collaborator

@gsk967 gsk967 commented Apr 14, 2023

Description

closes: #XXXX

Test the cosmwasm

bash ./noob/cosmwasm/setup-cosmwasm.sh
  • Run the sample cosmwasm (all tests should pass in the script)
    • It will upload the cosmwasm contract and initiate the contract and it will do some transactions and queries on the contract
bash ./noob/cosmwasm/test-cw20-base-cosmwasm.sh

Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • added appropriate labels to the PR
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@codecov
Copy link

codecov bot commented Apr 14, 2023

Codecov Report

Merging #1997 (1ef846e) into main (7f05ad4) will decrease coverage by 4.81%.
The diff coverage is 60.07%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1997      +/-   ##
==========================================
- Coverage   75.38%   70.58%   -4.81%     
==========================================
  Files         100      126      +26     
  Lines        8025     9580    +1555     
==========================================
+ Hits         6050     6762     +712     
- Misses       1589     2352     +763     
- Partials      386      466      +80     
Impacted Files Coverage Δ
util/store/unmarshal.go 0.00% <0.00%> (ø)
x/incentive/codec.go 47.82% <ø> (+9.89%) ⬆️
x/incentive/keeper/hooks.go 0.00% <0.00%> (ø)
x/incentive/keeper/invariants.go 0.00% <0.00%> (ø)
x/leverage/keeper/incentive.go 0.00% <0.00%> (ø)
x/leverage/types/keys.go 100.00% <ø> (ø)
x/leverage/types/proposal.go 33.33% <0.00%> (ø)
x/oracle/keeper/hooks.go 95.65% <ø> (ø)
x/oracle/types/keys.go 90.47% <ø> (ø)
x/oracle/types/msgs.go 81.05% <0.00%> (ø)
... and 54 more

... and 3 files with indirect coverage changes

@gsk967 gsk967 marked this pull request as ready for review April 14, 2023 16:08
@gsk967 gsk967 requested a review from a team as a code owner April 14, 2023 16:08
app/wasm/msg/types.go Outdated Show resolved Hide resolved
@gsk967 gsk967 requested a review from toteki April 17, 2023 10:32
@gsk967 gsk967 enabled auto-merge April 17, 2023 10:32
Copy link
Member

@toteki toteki left a comment

Choose a reason for hiding this comment

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

(Be sure to use the var names name consistent with message name for MsgSupplyCollateral)

A question:

Do these handlers carry any risk of bypassing GetSigners security? For example, the rule where MsgSupply.Supplier field must be the same address that signed it

app/wasm/msg/types.go Outdated Show resolved Hide resolved
app/wasm/msg/types.go Outdated Show resolved Hide resolved
app/wasm/msg/handler_leverage.go Outdated Show resolved Hide resolved
app/wasm/msg/plugin.go Outdated Show resolved Hide resolved
@RafilxTenfen
Copy link
Contributor

Do these handlers carry any risk of bypassing GetSigners security? For example, the rule where MsgSupply.Supplier field must be the same address that signed it

It should not bypass the signer's rule, it is the same as sending a msg through the leverage MsgServer, but definitely we can double-check that with a script/test

@gsk967 gsk967 changed the title feat(WIP): add the custom handlers for cosmwasm feat: add the custom handlers for cosmwasm Apr 18, 2023
@gsk967 gsk967 requested a review from toteki April 20, 2023 03:11
@gsk967 gsk967 requested a review from robert-zaremba May 3, 2023 08:56
Copy link
Member

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

let's check if there is other way than the big ambiguous JSON. I indicated already half a year ago, but didn't a good example. Osmosis is also using this style. It works, so not blocking, but let's find out if there is no better way before merging.

@gsk967 gsk967 added this pull request to the merge queue May 25, 2023
Merged via the queue into main with commit bd2579b May 25, 2023
@gsk967 gsk967 deleted the sai/wasm_handler branch May 25, 2023 05:38
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.

4 participants