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

[R4R] Add deposit address and do some refactor #101

Merged
merged 8 commits into from
Mar 29, 2019

Conversation

yutianwu
Copy link
Contributor

Description

When ppl deposit coins to a proposal, we will add these tokens to a specific address.

And do some refactor.

Rationale

tell us why we need these changes...

Example

Add upgrade config in app.toml

Changes

Notable changes:

  • add deposit address
  • do some refactor

Preflight checks

  • build passed (make build)
  • tests passed (make test)
  • integration tests passed (make integration_test)
  • manual transaction test passed (cli invoke)

Already reviewed by

...

Related issues

... reference related issue #'s here ...

x/gov/keeper.go Outdated
ParamStoreKeyDepositParams = []byte("depositparams")
ParamStoreKeyTallyParams = []byte("tallyparams")

DepositedCoinsAccAddr = sdk.AccAddress{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Copy link
Contributor

@HaoyangLiu HaoyangLiu Mar 29, 2019

Choose a reason for hiding this comment

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

Is it proper to use 0x00000000000000000000 as deposit address? Cosmos uses the following method to generate address.

	DepositedCoinsAccAddr     = sdk.AccAddress(crypto.AddressHash([]byte("govDepositedCoins")))
	BurnedDepositCoinsAccAddr = sdk.AccAddress(crypto.AddressHash([]byte("govBurnedDepositCoins")))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, it will use sha256 and get 20 bytes from it.
@darren-liu what's your point

Copy link
Contributor

Choose a reason for hiding this comment

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

we never burn by chain itself.

but I think we may need a better addresses.

x/gov/keeper.go Outdated
ParamStoreKeyDepositParams = []byte("depositparams")
ParamStoreKeyTallyParams = []byte("tallyparams")

DepositedCoinsAccAddr = sdk.AccAddress{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Copy link
Contributor

Choose a reason for hiding this comment

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

we never burn by chain itself.

but I think we may need a better addresses.

@yutianwu yutianwu merged commit 115a52b into develop Mar 29, 2019
@ackratos
Copy link
Contributor

ackratos commented Apr 1, 2019

please make sure Erheng know this change (1. the new address in QA and Testnet 2. include all deposits amount to handle deposit/voting expire) to his recon service...

yutianwu pushed a commit that referenced this pull request Apr 1, 2019
* R4R: Add interface to remove validator (#91)

* Add validator remove interface

* add unit test

* Fix failed unit test in gov and stake

* Add proposal id checking in msg validate

* Add validator consensus addr into proposal decription

* Add remove validator command line interface

* Add new proposal type to NormalizeProposalType

* add validator consensus address checking

* Rename consensus address flag name

* refactor handler test import

* Use json marshal to replace cdc marshal

* Add automatic gov proposal when proposal id is zero

* add deposit flag

* Add routerCallRecord

* Resolve comment, a tx only contains one msg

* improve the validate logic for remove validator

* refactor go import

* remove necessary checking

* stake: add fee addr for each validator

* [R4R] update gov strategy (#73)

* update gov strategy

* refactor

* revert change

* [R4R] Add deposit address and do some refactor (#101)

* add address for deposits

* refactor

* refactor

* revert change

* refactor

* refactor

* change proposals to publish

* update deposit address
@forcodedancing forcodedancing deleted the feature/add_deposit_addr branch May 18, 2022 07:11
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