-
Notifications
You must be signed in to change notification settings - Fork 1
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
Migrate to cw-assets v3 and cw-storage-plus v1.2.0 #5
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good. I have some concerns of not using AssetKey anymore but maybe that is a requirement for moving to cw-assets v3
WHITELIST | ||
.load(deps.storage, asset_key.clone()) | ||
.load(deps.storage, &asset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not keep the AssetInfoKey ?
To be fair it is just a type overwriting a type but how do you feel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AssetInfoKey
does not exist in cw-assets v3, that's the whole point of this migration, should probably have mentioned it above
let total_reward_distributed = Decimal::from_atomics(rewards_collected, 0)? | ||
* asset_distribution.distribution | ||
/ total_distribution; | ||
|
||
// If there are no balances, we stop updating the rate. This means that the emissions are not directed to any stakers. | ||
let total_balance = TOTAL_BALANCES | ||
.load(deps.storage, asset_key.clone()) | ||
.load(deps.storage, &asset_distribution.asset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check but maybe this causes migrations. If not then I am happy with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all of it causes migrations 😅
} | ||
|
||
fn migrate_whitelist_map(deps: DepsMut) -> Result<(), ContractError> { | ||
const OLD_WHITELIST: Map016<cw_asset_v2::AssetInfoKey, ChainId> = Map016::new("whitelist"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does cw_asset_v3 not have an assetKey?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct
This PR upgrades the cw-assets and cw-storage-plus dependencies of the alliance-hub contract in preparation to tweaks for eris' ve3-contracts.