Cosmos-sdk: Keys are declared as var and exposed

Created on 15 Jun 2018  路  12Comments  路  Source: cosmos/cosmos-sdk

https://github.com/cosmos/cosmos-sdk/blob/develop/x/stake/keeper_keys.go#L15

Other code can modify this values to cause unexpected behavior

Legacy API staking

Most helpful comment

We should expose some of these for querying from the store.

All 12 comments

cc @rigelrozanski

Yeah need to be constants and modified to a different type

Closes by #1119

My bad, I misread what this issue was for. Relevant keys have been moved to /x/stake/stake.go

Pretty sure this has been addressed. Going to close this issue. Please reopen and send any 馃敟 -> @jackzampolin

Pretty sure this has been addressed. Going to go ahead and close. Please reopen if I'm wrong.

We should expose some of these for querying from the store.

(I'm not sure if this is a serious security concern, but the original state of affairs has not changed)

Indeed, string constants should remain exported (eg. for use in queriers). Any keys used for persistent in stores should be constants and private if possible.

Closing this issue as addressed.

Was this page helpful?
0 / 5 - 0 ratings