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: initialize fswap module #1336

Merged
merged 17 commits into from
Apr 18, 2024
Merged

feat: initialize fswap module #1336

merged 17 commits into from
Apr 18, 2024

Conversation

170210
Copy link
Contributor

@170210 170210 commented Apr 11, 2024

Description

initialize fswap module

  • make proto file
  • prepare module template

Motivation and context

How has this been tested?

Screenshots (if appropriate):

Checklist:

  • I followed the contributing guidelines and code of conduct.
  • I have added a relevant changelog to CHANGELOG.md
  • I have added tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have updated API documentation client/docs/swagger-ui/swagger.yaml

@170210
Copy link
Contributor Author

170210 commented Apr 11, 2024

Is it necessary to update CHANGLOG.md

@170210 170210 self-assigned this Apr 11, 2024
@170210 170210 marked this pull request as ready for review April 11, 2024 11:26
@jaeseung-bae
Copy link
Contributor

jaeseung-bae commented Apr 11, 2024

Is it necessary to update CHANGLOG.md

I'm not sure.
I think, It's okay to update changelog once when we launch this module to main branch.

@170210 170210 marked this pull request as draft April 11, 2024 11:35
Signed-off-by: 170210 <[email protected]>
@170210 170210 marked this pull request as ready for review April 12, 2024 04:41
Copy link

codecov bot commented Apr 12, 2024

Codecov Report

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

Project coverage is 70.30%. Comparing base (55b6566) to head (fea7a93).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##            pjdp1    #1336      +/-   ##
==========================================
- Coverage   70.38%   70.30%   -0.08%     
==========================================
  Files         643      654      +11     
  Lines       54793    54871      +78     
==========================================
+ Hits        38564    38575      +11     
- Misses      14054    14121      +67     
  Partials     2175     2175              
Files Coverage Δ
x/fswap/types/genesis.go 100.00% <100.00%> (ø)
x/fswap/types/keys.go 0.00% <0.00%> (ø)
x/fswap/keeper/params.go 0.00% <0.00%> (ø)
x/fswap/types/codec.go 0.00% <0.00%> (ø)
x/fswap/types/params.go 66.66% <66.66%> (ø)
x/fswap/handler.go 0.00% <0.00%> (ø)
x/fswap/keeper/grpc_query.go 0.00% <0.00%> (ø)
x/fswap/genesis.go 0.00% <0.00%> (ø)
x/fswap/keeper/msg_server.go 0.00% <0.00%> (ø)
x/fswap/keeper/keeper.go 0.00% <0.00%> (ø)
... and 1 more

@170210
Copy link
Contributor Author

170210 commented Apr 12, 2024

Please ignore codecov, this is just a initial template.

proto/lbm/fswap/v1/genesis.proto Show resolved Hide resolved
proto/lbm/fswap/v1/params.proto Show resolved Hide resolved
proto/lbm/fswap/v1/query.proto Show resolved Hide resolved
proto/lbm/fswap/v1/tx.proto Show resolved Hide resolved
proto/lbm/fswap/v1/event.proto Show resolved Hide resolved
proto/lbm/fswap/v1/params.proto Outdated Show resolved Hide resolved
proto/lbm/fswap/v1/tx.proto Outdated Show resolved Hide resolved
@tkxkd0159 tkxkd0159 changed the base branch from feat/x-fswap to pjdp1 April 15, 2024 05:37
@170210 170210 requested a review from jaeseung-bae April 15, 2024 05:50
@170210
Copy link
Contributor Author

170210 commented Apr 15, 2024

Should I remove this part. I think it should be init in genesis.go, because this is calculated by the current fnsa amounts.

// upper limit in new coin that this module can swap
cosmos.base.v1beta1.Coin new_coin_swap_total_limit = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];

proto/lbm/fswap/v1/genesis.proto Show resolved Hide resolved
proto/lbm/fswap/v1/params.proto Outdated Show resolved Hide resolved
proto/lbm/fswap/v1/params.proto Outdated Show resolved Hide resolved
x/fswap/genesis.go Show resolved Hide resolved
x/fswap/genesis.go Show resolved Hide resolved
x/fswap/keeper/keeper.go Outdated Show resolved Hide resolved
x/fswap/module.go Outdated Show resolved Hide resolved
x/fswap/types/msgs.go Outdated Show resolved Hide resolved
Copy link
Member

@zemyblue zemyblue left a comment

Choose a reason for hiding this comment

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

Can we query the swap rate?

@170210
Copy link
Contributor Author

170210 commented Apr 16, 2024

I heard that it is a constant value. Should we make a query for it? If it is needed, I think we can add it to the following query.

message QueryTotalSwappableAmountRequest {}
message QueryTotalSwappableAmountResponse {
cosmos.base.v1beta1.Coin swappable_new_coin_amount = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];
}

Signed-off-by: 170210 <[email protected]>
@170210 170210 requested a review from zemyblue April 17, 2024 09:44
jaeseung-bae
jaeseung-bae previously approved these changes Apr 18, 2024
x/fswap/types/params.go Outdated Show resolved Hide resolved
x/fswap/types/params.go Outdated Show resolved Hide resolved
x/fswap/module.go Outdated Show resolved Hide resolved
Signed-off-by: 170210 <[email protected]>
@170210 170210 merged commit 6afe633 into Finschia:pjdp1 Apr 18, 2024
32 of 33 checks passed
jaeseung-bae added a commit that referenced this pull request May 3, 2024
* feat: initialize fswap module (#1336)

* feat: initial fswap module

Signed-off-by: 170210 <[email protected]>

* chore: correct dependencies

Signed-off-by: 170210 <[email protected]>

* chore: remove unuse files

Signed-off-by: 170210 <[email protected]>

* feat: add proto files

Signed-off-by: 170210 <[email protected]>

* chore: make proto-gen

Signed-off-by: 170210 <[email protected]>

* chore: fix compile error

Signed-off-by: 170210 <[email protected]>

* chore: add new field in params proto

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* feat: add query&tx commands of fswap module

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

* docs: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* docs: fix error docs

Signed-off-by: 170210 <[email protected]>

* fix: fix consensusversion

Signed-off-by: 170210 <[email protected]>

* fix: remove route,type&getSignBytes in msgs.go

Signed-off-by: 170210 <[email protected]>

* fix: update proto files

Signed-off-by: 170210 <[email protected]>

* fix: fix NewKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: implement fswap module's genesis and params (#1339)

* feat: implement genesis related functions

Signed-off-by: 170210 <[email protected]>

* chore: use mockgen

Signed-off-by: 170210 <[email protected]>

* chore: add tests

Signed-off-by: 170210 <[email protected]>

* fix: add subspace in paramsKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix for test errors

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix appmodulebasic

Signed-off-by: 170210 <[email protected]>

* chore: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* fix: use configuration instead of params

Signed-off-by: 170210 <[email protected]>

* chore: refactor new&default fswapped

Signed-off-by: 170210 <[email protected]>

* fix: add total_supply into genesisStatus & remove calculate logic

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix module_simulation

Signed-off-by: 170210 <[email protected]>

* fix: set swappableNewCoinDenom as params

Signed-off-by: 170210 <[email protected]>

* fix: change total_supply name to swappableNewCoinAmount

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: use io/collection to generate key

Signed-off-by: 170210 <[email protected]>

* Revert "fix: use io/collection to generate key"

This reverts commit e42e064.

* fix: change sdk.Coin to sdk.Int

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: remote unnecessary codes

Signed-off-by: 170210 <[email protected]>

* fix: add validate for swappable new coin

Signed-off-by: 170210 <[email protected]>

* fix: add randomizedGenState

Signed-off-by: 170210 <[email protected]>

* fix: fix error doc

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: change proto message fields' name

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: initialize fbridge module (#1340)

* initialize fbridge module

* add all proto files for fbridge

* add missing proto files

* initialize module structure

* modify proto based on discussion

* add codec

* add CHANGELOG

* modify UpdateRole feature

* feat: fbridge transfer (#1347)

* impl bridge transfer tx/query

* add CLI

* feat: save sequence for every bridge request (#1351)

* feat: add SeqToBlocknum

* add CHANGELOG

* add query bound for SeqToBlocknums

* feat: fswap module's basic functionality(MsgSwap, MsgSwapAll, Query, Proposal) (#1345)

* refactor: fswap module's proto

Signed-off-by: 170210 <[email protected]>

* refactor: remove config&params and modify genesis

Signed-off-by: 170210 <[email protected]>

* refactor: use gov/proposal to change fswapInit

Signed-off-by: 170210 <[email protected]>

* chore: fix simulation

Signed-off-by: 170210 <[email protected]>

* chore: correct query cli

Signed-off-by: 170210 <[email protected]>

* chore: add query for test

Signed-off-by: 170210 <[email protected]>

* chore: lint fix

* chore: fix for tx cli

* chore: update proto

* chore: update genesis logic

* chore: add basic tx and queries

* chore: rename fswap to swap

* chore: change old/new to from/to

* chore: clean-up

* chore: clean errors and rename

* chore: update proto

* chore: clean unnecessary member variables

* chore: update proto, introduce config, clean code

* chore: remove redundant denom validation

* chore: remove cache-like operation, rename swap proposal in proto, errors start with number 2

* chore: apply feedbacks

* chore: fix some

* chore: fix for initGenesis

* chore: apply feedbacks

* chore: update changelog

* chore: remove redundant logic

* chore: update error doc

* chore: update proto and logic to accept bank.Metadata

* chore: add query to get all the swaps

* chore: change swap_multiple to swap_rate

* chore: disallow updating existing denom metadata with different values

* chore: fix for calcSwap logic

* chore: extract CalcSwap to function

* chore: add missing query cmd

* chore: fix for proposal cli

* chore: fix for init timing

* chore: fix query cli

* chore: fix to prevent generating swap more than MaxSwaps

* fix: add missing call validateBasic for proposal

* fix:

* chore: change error type for temporal test-pass

* chore: fix for make-swap-proposal update

* chore: fix to check swap count after increase in order not to make more than limit

* chore: prevent any proposal with different denom

* chore: change amount cap type

* chore: fix codec-related parts

* chore: minor change for convert to-coin-amount-cap

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: jaeseung.bae <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: 170210 <[email protected]>
Co-authored-by: Jayden Lee <[email protected]>
jaeseung-bae added a commit to jaeseung-bae/finschia-sdk that referenced this pull request May 7, 2024
* feat: initialize fswap module (Finschia#1336)

* feat: initial fswap module

Signed-off-by: 170210 <[email protected]>

* chore: correct dependencies

Signed-off-by: 170210 <[email protected]>

* chore: remove unuse files

Signed-off-by: 170210 <[email protected]>

* feat: add proto files

Signed-off-by: 170210 <[email protected]>

* chore: make proto-gen

Signed-off-by: 170210 <[email protected]>

* chore: fix compile error

Signed-off-by: 170210 <[email protected]>

* chore: add new field in params proto

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* feat: add query&tx commands of fswap module

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

* docs: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* docs: fix error docs

Signed-off-by: 170210 <[email protected]>

* fix: fix consensusversion

Signed-off-by: 170210 <[email protected]>

* fix: remove route,type&getSignBytes in msgs.go

Signed-off-by: 170210 <[email protected]>

* fix: update proto files

Signed-off-by: 170210 <[email protected]>

* fix: fix NewKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: implement fswap module's genesis and params (Finschia#1339)

* feat: implement genesis related functions

Signed-off-by: 170210 <[email protected]>

* chore: use mockgen

Signed-off-by: 170210 <[email protected]>

* chore: add tests

Signed-off-by: 170210 <[email protected]>

* fix: add subspace in paramsKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix for test errors

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix appmodulebasic

Signed-off-by: 170210 <[email protected]>

* chore: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* fix: use configuration instead of params

Signed-off-by: 170210 <[email protected]>

* chore: refactor new&default fswapped

Signed-off-by: 170210 <[email protected]>

* fix: add total_supply into genesisStatus & remove calculate logic

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix module_simulation

Signed-off-by: 170210 <[email protected]>

* fix: set swappableNewCoinDenom as params

Signed-off-by: 170210 <[email protected]>

* fix: change total_supply name to swappableNewCoinAmount

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: use io/collection to generate key

Signed-off-by: 170210 <[email protected]>

* Revert "fix: use io/collection to generate key"

This reverts commit e42e064.

* fix: change sdk.Coin to sdk.Int

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: remote unnecessary codes

Signed-off-by: 170210 <[email protected]>

* fix: add validate for swappable new coin

Signed-off-by: 170210 <[email protected]>

* fix: add randomizedGenState

Signed-off-by: 170210 <[email protected]>

* fix: fix error doc

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: change proto message fields' name

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: initialize fbridge module (Finschia#1340)

* initialize fbridge module

* add all proto files for fbridge

* add missing proto files

* initialize module structure

* modify proto based on discussion

* add codec

* add CHANGELOG

* modify UpdateRole feature

* feat: fbridge transfer (Finschia#1347)

* impl bridge transfer tx/query

* add CLI

* feat: save sequence for every bridge request (Finschia#1351)

* feat: add SeqToBlocknum

* add CHANGELOG

* add query bound for SeqToBlocknums

* feat: fswap module's basic functionality(MsgSwap, MsgSwapAll, Query, Proposal) (Finschia#1345)

* refactor: fswap module's proto

Signed-off-by: 170210 <[email protected]>

* refactor: remove config&params and modify genesis

Signed-off-by: 170210 <[email protected]>

* refactor: use gov/proposal to change fswapInit

Signed-off-by: 170210 <[email protected]>

* chore: fix simulation

Signed-off-by: 170210 <[email protected]>

* chore: correct query cli

Signed-off-by: 170210 <[email protected]>

* chore: add query for test

Signed-off-by: 170210 <[email protected]>

* chore: lint fix

* chore: fix for tx cli

* chore: update proto

* chore: update genesis logic

* chore: add basic tx and queries

* chore: rename fswap to swap

* chore: change old/new to from/to

* chore: clean-up

* chore: clean errors and rename

* chore: update proto

* chore: clean unnecessary member variables

* chore: update proto, introduce config, clean code

* chore: remove redundant denom validation

* chore: remove cache-like operation, rename swap proposal in proto, errors start with number 2

* chore: apply feedbacks

* chore: fix some

* chore: fix for initGenesis

* chore: apply feedbacks

* chore: update changelog

* chore: remove redundant logic

* chore: update error doc

* chore: update proto and logic to accept bank.Metadata

* chore: add query to get all the swaps

* chore: change swap_multiple to swap_rate

* chore: disallow updating existing denom metadata with different values

* chore: fix for calcSwap logic

* chore: extract CalcSwap to function

* chore: add missing query cmd

* chore: fix for proposal cli

* chore: fix for init timing

* chore: fix query cli

* chore: fix to prevent generating swap more than MaxSwaps

* fix: add missing call validateBasic for proposal

* fix:

* chore: change error type for temporal test-pass

* chore: fix for make-swap-proposal update

* chore: fix to check swap count after increase in order not to make more than limit

* chore: prevent any proposal with different denom

* chore: change amount cap type

* chore: fix codec-related parts

* chore: minor change for convert to-coin-amount-cap

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: jaeseung.bae <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: 170210 <[email protected]>
Co-authored-by: Jayden Lee <[email protected]>
jaeseung-bae added a commit to jaeseung-bae/finschia-sdk that referenced this pull request May 7, 2024
* feat: initialize fswap module (Finschia#1336)

* feat: initial fswap module

Signed-off-by: 170210 <[email protected]>

* chore: correct dependencies

Signed-off-by: 170210 <[email protected]>

* chore: remove unuse files

Signed-off-by: 170210 <[email protected]>

* feat: add proto files

Signed-off-by: 170210 <[email protected]>

* chore: make proto-gen

Signed-off-by: 170210 <[email protected]>

* chore: fix compile error

Signed-off-by: 170210 <[email protected]>

* chore: add new field in params proto

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* feat: add query&tx commands of fswap module

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

* docs: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* docs: fix error docs

Signed-off-by: 170210 <[email protected]>

* fix: fix consensusversion

Signed-off-by: 170210 <[email protected]>

* fix: remove route,type&getSignBytes in msgs.go

Signed-off-by: 170210 <[email protected]>

* fix: update proto files

Signed-off-by: 170210 <[email protected]>

* fix: fix NewKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: implement fswap module's genesis and params (Finschia#1339)

* feat: implement genesis related functions

Signed-off-by: 170210 <[email protected]>

* chore: use mockgen

Signed-off-by: 170210 <[email protected]>

* chore: add tests

Signed-off-by: 170210 <[email protected]>

* fix: add subspace in paramsKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix for test errors

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix appmodulebasic

Signed-off-by: 170210 <[email protected]>

* chore: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* fix: use configuration instead of params

Signed-off-by: 170210 <[email protected]>

* chore: refactor new&default fswapped

Signed-off-by: 170210 <[email protected]>

* fix: add total_supply into genesisStatus & remove calculate logic

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix module_simulation

Signed-off-by: 170210 <[email protected]>

* fix: set swappableNewCoinDenom as params

Signed-off-by: 170210 <[email protected]>

* fix: change total_supply name to swappableNewCoinAmount

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: use io/collection to generate key

Signed-off-by: 170210 <[email protected]>

* Revert "fix: use io/collection to generate key"

This reverts commit e42e064.

* fix: change sdk.Coin to sdk.Int

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: remote unnecessary codes

Signed-off-by: 170210 <[email protected]>

* fix: add validate for swappable new coin

Signed-off-by: 170210 <[email protected]>

* fix: add randomizedGenState

Signed-off-by: 170210 <[email protected]>

* fix: fix error doc

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: change proto message fields' name

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: initialize fbridge module (Finschia#1340)

* initialize fbridge module

* add all proto files for fbridge

* add missing proto files

* initialize module structure

* modify proto based on discussion

* add codec

* add CHANGELOG

* modify UpdateRole feature

* feat: fbridge transfer (Finschia#1347)

* impl bridge transfer tx/query

* add CLI

* feat: save sequence for every bridge request (Finschia#1351)

* feat: add SeqToBlocknum

* add CHANGELOG

* add query bound for SeqToBlocknums

* feat: fswap module's basic functionality(MsgSwap, MsgSwapAll, Query, Proposal) (Finschia#1345)

* refactor: fswap module's proto

Signed-off-by: 170210 <[email protected]>

* refactor: remove config&params and modify genesis

Signed-off-by: 170210 <[email protected]>

* refactor: use gov/proposal to change fswapInit

Signed-off-by: 170210 <[email protected]>

* chore: fix simulation

Signed-off-by: 170210 <[email protected]>

* chore: correct query cli

Signed-off-by: 170210 <[email protected]>

* chore: add query for test

Signed-off-by: 170210 <[email protected]>

* chore: lint fix

* chore: fix for tx cli

* chore: update proto

* chore: update genesis logic

* chore: add basic tx and queries

* chore: rename fswap to swap

* chore: change old/new to from/to

* chore: clean-up

* chore: clean errors and rename

* chore: update proto

* chore: clean unnecessary member variables

* chore: update proto, introduce config, clean code

* chore: remove redundant denom validation

* chore: remove cache-like operation, rename swap proposal in proto, errors start with number 2

* chore: apply feedbacks

* chore: fix some

* chore: fix for initGenesis

* chore: apply feedbacks

* chore: update changelog

* chore: remove redundant logic

* chore: update error doc

* chore: update proto and logic to accept bank.Metadata

* chore: add query to get all the swaps

* chore: change swap_multiple to swap_rate

* chore: disallow updating existing denom metadata with different values

* chore: fix for calcSwap logic

* chore: extract CalcSwap to function

* chore: add missing query cmd

* chore: fix for proposal cli

* chore: fix for init timing

* chore: fix query cli

* chore: fix to prevent generating swap more than MaxSwaps

* fix: add missing call validateBasic for proposal

* fix:

* chore: change error type for temporal test-pass

* chore: fix for make-swap-proposal update

* chore: fix to check swap count after increase in order not to make more than limit

* chore: prevent any proposal with different denom

* chore: change amount cap type

* chore: fix codec-related parts

* chore: minor change for convert to-coin-amount-cap

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: jaeseung.bae <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: 170210 <[email protected]>
Co-authored-by: Jayden Lee <[email protected]>
jaeseung-bae added a commit that referenced this pull request May 7, 2024
* feat: introduce new modules(fswap, fbridge) (#1352)

* feat: initialize fswap module (#1336)

* feat: initial fswap module

Signed-off-by: 170210 <[email protected]>

* chore: correct dependencies

Signed-off-by: 170210 <[email protected]>

* chore: remove unuse files

Signed-off-by: 170210 <[email protected]>

* feat: add proto files

Signed-off-by: 170210 <[email protected]>

* chore: make proto-gen

Signed-off-by: 170210 <[email protected]>

* chore: fix compile error

Signed-off-by: 170210 <[email protected]>

* chore: add new field in params proto

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* feat: add query&tx commands of fswap module

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

* docs: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* docs: fix error docs

Signed-off-by: 170210 <[email protected]>

* fix: fix consensusversion

Signed-off-by: 170210 <[email protected]>

* fix: remove route,type&getSignBytes in msgs.go

Signed-off-by: 170210 <[email protected]>

* fix: update proto files

Signed-off-by: 170210 <[email protected]>

* fix: fix NewKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix for comment

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: implement fswap module's genesis and params (#1339)

* feat: implement genesis related functions

Signed-off-by: 170210 <[email protected]>

* chore: use mockgen

Signed-off-by: 170210 <[email protected]>

* chore: add tests

Signed-off-by: 170210 <[email protected]>

* fix: add subspace in paramsKeeper

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix for test errors

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix appmodulebasic

Signed-off-by: 170210 <[email protected]>

* chore: update CHANGLOG.md

Signed-off-by: 170210 <[email protected]>

* fix: use configuration instead of params

Signed-off-by: 170210 <[email protected]>

* chore: refactor new&default fswapped

Signed-off-by: 170210 <[email protected]>

* fix: add total_supply into genesisStatus & remove calculate logic

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: fix module_simulation

Signed-off-by: 170210 <[email protected]>

* fix: set swappableNewCoinDenom as params

Signed-off-by: 170210 <[email protected]>

* fix: change total_supply name to swappableNewCoinAmount

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: use io/collection to generate key

Signed-off-by: 170210 <[email protected]>

* Revert "fix: use io/collection to generate key"

This reverts commit e42e064.

* fix: change sdk.Coin to sdk.Int

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: remote unnecessary codes

Signed-off-by: 170210 <[email protected]>

* fix: add validate for swappable new coin

Signed-off-by: 170210 <[email protected]>

* fix: add randomizedGenState

Signed-off-by: 170210 <[email protected]>

* fix: fix error doc

Signed-off-by: 170210 <[email protected]>

* fix: fix lint

Signed-off-by: 170210 <[email protected]>

* fix: change proto message fields' name

Signed-off-by: 170210 <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>

* feat: initialize fbridge module (#1340)

* initialize fbridge module

* add all proto files for fbridge

* add missing proto files

* initialize module structure

* modify proto based on discussion

* add codec

* add CHANGELOG

* modify UpdateRole feature

* feat: fbridge transfer (#1347)

* impl bridge transfer tx/query

* add CLI

* feat: save sequence for every bridge request (#1351)

* feat: add SeqToBlocknum

* add CHANGELOG

* add query bound for SeqToBlocknums

* feat: fswap module's basic functionality(MsgSwap, MsgSwapAll, Query, Proposal) (#1345)

* refactor: fswap module's proto

Signed-off-by: 170210 <[email protected]>

* refactor: remove config&params and modify genesis

Signed-off-by: 170210 <[email protected]>

* refactor: use gov/proposal to change fswapInit

Signed-off-by: 170210 <[email protected]>

* chore: fix simulation

Signed-off-by: 170210 <[email protected]>

* chore: correct query cli

Signed-off-by: 170210 <[email protected]>

* chore: add query for test

Signed-off-by: 170210 <[email protected]>

* chore: lint fix

* chore: fix for tx cli

* chore: update proto

* chore: update genesis logic

* chore: add basic tx and queries

* chore: rename fswap to swap

* chore: change old/new to from/to

* chore: clean-up

* chore: clean errors and rename

* chore: update proto

* chore: clean unnecessary member variables

* chore: update proto, introduce config, clean code

* chore: remove redundant denom validation

* chore: remove cache-like operation, rename swap proposal in proto, errors start with number 2

* chore: apply feedbacks

* chore: fix some

* chore: fix for initGenesis

* chore: apply feedbacks

* chore: update changelog

* chore: remove redundant logic

* chore: update error doc

* chore: update proto and logic to accept bank.Metadata

* chore: add query to get all the swaps

* chore: change swap_multiple to swap_rate

* chore: disallow updating existing denom metadata with different values

* chore: fix for calcSwap logic

* chore: extract CalcSwap to function

* chore: add missing query cmd

* chore: fix for proposal cli

* chore: fix for init timing

* chore: fix query cli

* chore: fix to prevent generating swap more than MaxSwaps

* fix: add missing call validateBasic for proposal

* fix:

* chore: change error type for temporal test-pass

* chore: fix for make-swap-proposal update

* chore: fix to check swap count after increase in order not to make more than limit

* chore: prevent any proposal with different denom

* chore: change amount cap type

* chore: fix codec-related parts

* chore: minor change for convert to-coin-amount-cap

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: jaeseung.bae <[email protected]>

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: 170210 <[email protected]>
Co-authored-by: Jayden Lee <[email protected]>

* chore: lint fix

---------

Signed-off-by: 170210 <[email protected]>
Co-authored-by: 170210 <[email protected]>
Co-authored-by: Jayden Lee <[email protected]>
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