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

Add new message Deposit ZRC20 in the fungible module #3309

Open
Tracked by #2992
kingpinXD opened this issue Dec 17, 2024 · 3 comments
Open
Tracked by #2992

Add new message Deposit ZRC20 in the fungible module #3309

kingpinXD opened this issue Dec 17, 2024 · 3 comments
Assignees
Labels
zetacore Issues related to ZetaCore

Comments

@kingpinXD
Copy link
Contributor

kingpinXD commented Dec 17, 2024

The logic to Lock a ZRC20 through a precomipile is present here

https://github.com/zeta-chain/zeta-node/blob/5fd8314fa090009cc968a4227c9e79f861a102cb/precompiles/bank/method_deposit.go#L62-L110

This can be extracted to a MsgDepositZRC20
The MsgDepositZRC20 can be then called from the precompile using the fungible keeper

	msgServer := fungibleKeeper.NewMsgServerImpl(&c.fungibleKeeper)
	res, err := msgServer.DepositZRC20(ctx, &fungibleTypes.MsgDepositZRC20{}

Expected Outcomes

  • MsgDepositZRC20 is defined
  • Unit Tests and Simulation tests present for MsgDepositZRC20
@lumtis lumtis changed the title Add new message Deposit ZRC20 in the funcgible module Add new message Deposit ZRC20 in the fungible module Dec 17, 2024
@lumtis
Copy link
Member

lumtis commented Dec 17, 2024

Can we please add a description of the problem? We should avoid adding new messages if not necessary

@lumtis
Copy link
Member

lumtis commented Dec 17, 2024

It would be worth spending some time investigating an alternative.

I see it as a bad idea to implement this and #3311, #3310

Messages are a lot of LoC and we shouldn't bring more in the codebase that is already complex for the sake of simulation. Same as you don't add more method in the public API of a Go package to help with tests.

We should check if there are way to extend the simulation framework to run eth txs or smth else

@kingpinXD
Copy link
Contributor Author

Can we please add a description of the problem? We should avoid adding new messages if not necessary

The problem and the reason behind this solution is mentioned here on the parent issue
#2992 (comment)

@kingpinXD kingpinXD self-assigned this Dec 17, 2024
@kingpinXD kingpinXD added the zetacore Issues related to ZetaCore label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
zetacore Issues related to ZetaCore
Projects
None yet
Development

No branches or pull requests

2 participants