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: implement SubmitConsent tx #533

Merged
merged 22 commits into from
Dec 12, 2022
Merged

Conversation

gyuguen
Copy link
Contributor

@gyuguen gyuguen commented Dec 7, 2022

Close #513

Implement

  • Added submitConsent
    • verify signature
    • verify signed oracle
    • verify deal
    • verify duplicate certificate
    • send reward
    • post process of deal

@gyuguen gyuguen added this to the v2.1.0-beta milestone Dec 7, 2022
@gyuguen gyuguen requested a review from cl9200 as a code owner December 7, 2022 09:23
@gyuguen gyuguen self-assigned this Dec 7, 2022
@gyuguen
Copy link
Contributor Author

gyuguen commented Dec 7, 2022

I will add comment soon :)

@gyuguen gyuguen marked this pull request as draft December 8, 2022 00:16
@gyuguen gyuguen marked this pull request as ready for review December 8, 2022 00:33
@@ -428,12 +431,20 @@ func New(
app.BankKeeper,
)

app.oracleKeeper = *oraclekeeper.NewKeeper(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This oracle setup is already set in another PR.
I will change this code when merging

return fmt.Errorf("not enough balance in deal")
}

// TODO calculate oracle commission
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When after merged oracle feature, I will add a oracle commission.

Base automatically changed from ft/512/create_deal_keeper to main December 8, 2022 05:31
@gyuguen
Copy link
Contributor Author

gyuguen commented Dec 8, 2022

I added sdk.Msg in message_deal.go. (26101ad)
Because we are getting errors.

$ panacead q deal
        /home/junney/workspace/panacea-core/x/datadeal/module.go:55
        /home/junney/workspace/panacea-core/x/datadeal/module.go:55
github.com/cosmos/cosmos-sdk/types/module.BasicManager.RegisterInterfaces(...)
        /home/junney/go/pkg/mod/github.com/medibloc/cosmos-sdk@v0.45.9-panacea.1/types/module/module.go:86
github.com/medibloc/panacea-core/v2/app.MakeEncodingConfig()

...

x/oracle/keeper/keeper.go Outdated Show resolved Hide resolved
x/oracle/keeper/keeper.go Outdated Show resolved Hide resolved
x/datadeal/types/message_deal.go Show resolved Hide resolved
x/datadeal/keeper/certificate.go Outdated Show resolved Hide resolved
@youngjoon-lee
Copy link
Contributor

I added sdk.Msg in message_deal.go. (26101ad)

Could you share what the actual error message was? I can see only call stacks from your comment.

Copy link

@inchori inchori left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@audtlr24 audtlr24 left a comment

Choose a reason for hiding this comment

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

lgtm! Thanks

Copy link
Contributor

@0xHansLee 0xHansLee left a comment

Choose a reason for hiding this comment

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

LGTM

@gyuguen
Copy link
Contributor Author

gyuguen commented Dec 12, 2022

I added sdk.Msg in message_deal.go. (26101ad)

Could you share what the actual error message was? I can see only call stacks from your comment.

It seems to happen because of the line below.
https://github.com/medibloc/panacea-core/blob/ft/513/implement_submit_consent/x/datadeal/types/codec.go#L19

I wrote it ahead of time because we are gonna have to implement this struct anyway.

@gyuguen
Copy link
Contributor Author

gyuguen commented Dec 12, 2022

I added sdk.Msg in message_deal.go. (26101ad)

Could you share what the actual error message was? I can see only call stacks from your comment.

In fact, this error occurs from the init command.

$ panacead init
github.com/medibloc/panacea-core/v2/x/datadeal.AppModuleBasic.RegisterInterfaces(...)
        /home/junney/workspace/panacea-core/x/datadeal/module.go:55
github.com/cosmos/cosmos-sdk/types/module.BasicManager.RegisterInterfaces(...)
        /home/junney/go/pkg/mod/github.com/medibloc/cosmos-sdk@v0.45.9-panacea.1/types/module/module.go:86
github.com/medibloc/panacea-core/v2/app.MakeEncodingConfig()
        /home/junney/workspace/panacea-core/app/encoding.go:14 +0x1ca
github.com/medibloc/panacea-core/v2/cmd/panacead/cmd.NewRootCmd()
        /home/junney/workspace/panacea-core/cmd/panacead/cmd/root.go:52 +0x5f
main.main()
        /home/junney/workspace/panacea-core/cmd/panacead/main.go:12 +0x19

Copy link
Contributor

@youngjoon-lee youngjoon-lee left a comment

Choose a reason for hiding this comment

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

LGTM. Please rename the title of this PR as below, when you merge this PR to the main.

feat: implement SubmitConsent tx

@gyuguen gyuguen changed the title feat: implement submit consent feat: implement SubmitConsent tx Dec 12, 2022
@gyuguen gyuguen merged commit 781a7b9 into main Dec 12, 2022
@gyuguen gyuguen deleted the ft/513/implement_submit_consent branch December 12, 2022 06:26
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.

Implement SubmitConsent tx
5 participants