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/initia #182

Open
wants to merge 25 commits into
base: dev
Choose a base branch
from
Open

Feat/initia #182

wants to merge 25 commits into from

Conversation

ratik
Copy link
Collaborator

@ratik ratik commented Sep 12, 2024

Task

  • refactored puppeteer
  • small improvements into staker
  • initia puppeteer

@ratik ratik marked this pull request as ready for review September 18, 2024 13:56
@ratik ratik force-pushed the feat/initia branch 7 times, most recently from 20061ff to 794e277 Compare September 19, 2024 11:39
}

fn query_non_native_rewards_balances(deps: Deps<NeutronQuery>) -> ContractResult<Binary> {
let data = NON_NATIVE_REWARD_BALANCES.load(deps.storage)?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure it always contains value? Maybe implement it like in the balances and delegations query?

Comment on lines 237 to 244
ExecuteMsg::TokenizeShare {
validator,
amount,
reply_to,
} => execute_tokenize_share(deps, info, validator, amount, reply_to),
ExecuteMsg::RedeemShares { items, reply_to } => {
execute_redeem_shares(deps, info, items, reply_to)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Better return error for shares methods call because there is not shares in the initia

config.clone(),
vec![prepare_any_msg(
redelegate_msg,
"/cosmos.staking.v1beta1.MsgBeginRedelegate",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please check transaction type

}
if messages.is_empty() {
submessages.push(SubMsg::reply_on_success(
new_multiple_balances_query_msg(
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure this query will work with initia? Maybe it is better to return "not implemented", anyway this code will not work

)?;

Ok(SubMsg::reply_on_success(
new_register_delegator_unbonding_delegations_query_msg(
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I know unbonding delegations is not used anymore, maybe we can deprecate this method in this version of puppeteer?

let mut delegations: Vec<DropDelegation> = Vec::with_capacity(total_validators);

if total_validators > 0 {
println!("total_validators {}", total_validators);
Copy link
Contributor

Choose a reason for hiding this comment

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

please remove this debug outpout

_amount: Uint128,
_reply_to: String,
) -> ContractResult<Response<NeutronMsg>> {
panic!("Not implemented")
Copy link
Contributor

Choose a reason for hiding this comment

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

unimplemented!() is better

Suggested change
panic!("Not implemented")
unimplemented!()

_items: Vec<RedeemShareItem>,
_reply_to: String,
) -> ContractResult<Response<NeutronMsg>> {
panic!("Not implemented")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
panic!("Not implemented")
unimplemented!()

contracts/staker/src/contract.rs Show resolved Hide resolved
contracts/staker/src/contract.rs Outdated Show resolved Hide resolved
@oldremez oldremez marked this pull request as draft September 23, 2024 08:35
@ratik ratik marked this pull request as ready for review September 25, 2024 15:53
@albertandrejev albertandrejev changed the base branch from main to dev October 14, 2024 10:33
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