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

Single party pol v2 #146

Merged
merged 23 commits into from
Jan 19, 2024
Merged

Single party pol v2 #146

merged 23 commits into from
Jan 19, 2024

Conversation

Art3miX
Copy link
Collaborator

@Art3miX Art3miX commented Jan 8, 2024

Finished with the astroport lper withdraw change.
Finished with the single party holder logic.

Creating a "smaller" PR, before doing the double sided holder changes.

contracts/ibc-forwarder/src/helpers.rs Show resolved Hide resolved
contracts/single-party-pol-covenant/README.md Outdated Show resolved Hide resolved
contracts/single-party-pol-covenant/src/contract.rs Outdated Show resolved Hide resolved
contracts/single-party-pol-covenant/src/contract.rs Outdated Show resolved Hide resolved
&COVENANT_CLOCK_ADDR.may_load(deps.storage)?,
)?),
QueryMsg::HolderAddress {} => Ok(to_json_binary(&HOLDER_ADDR.may_load(deps.storage)?)?),
QueryMsg::IbcForwarderAddress { party } => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

adjust to a single party query with no params

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done?

// Verify percentage is < 1 and > 0
let holder_addr = HOLDER_ADDRESS
.load(deps.storage)
.map_err(|_| ContractError::MissingHolderError {})?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can skip this map err as in the instantiation we already do addr_validate and then save it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You are probably right, this error should never be reached in practice.

contracts/single-party-pol-covenant/src/msg.rs Outdated Show resolved Hide resolved
/// registers an interchain account on stride with port_id associated with `INTERCHAIN_ACCOUNT_ID`
fn try_register_stride_ica(deps: DepsMut, env: Env) -> NeutronResult<Response<NeutronMsg>> {
let remote_chain_info = REMOTE_CHAIN_INFO.load(deps.storage)?;
let register_fee: Option<Vec<Coin>> = Some(coins(1000001, "untrn"));
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets make this configurable

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Already done right?

contracts/stride-liquid-staker/src/error.rs Show resolved Hide resolved
contracts/stride-liquid-staker/src/msg.rs Show resolved Hide resolved
Comment on lines +165 to +166
withdrawer: Some(info.sender.to_string()),
withdraw_to: Some(info.sender.to_string()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The withdrawer / withdarw_to can be not the sender, in this case we rather get it as field, and also set it to be not optional.
The reason I kept it optional is because the parties can start the covenant and decide on what the addresses are at later point of time.

Comment on lines 229 to 244
QueryMsg::DepositAddress {} => {
let ica = query_deposit_address(deps, env)?;
// up to the querying module to make sense of the response
Ok(to_json_binary(&ica)?)
let ica = get_ica(deps, &env, INTERCHAIN_ACCOUNT_ID)?.0;

let autopilot = Autopilot {
autopilot: AutopilotConfig {
receiver: ica.to_string(),
stakeibc: crate::helpers::Stakeibc {
action: "LiquidStake".to_string(),
stride_address: ica,
},
},
};

let autopilot_str = to_json_string(&autopilot)?;

Ok(to_json_binary(&autopilot_str)?)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ehm what?

@@ -68,17 +68,40 @@ func (testCtx *TestContext) Tick(clock string, keyring string, from string) {
testCtx.SkipBlocks(3)
}

func (testCtx *TestContext) SkipBlocks(n int) {
func (testCtx *TestContext) TickStride(clock string, keyring string, from string) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whats the diff between that and the normal tick?

@bekauz bekauz merged commit 52fd1da into v2 Jan 19, 2024
6 of 12 checks passed
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.

2 participants