Skip to content

Commit

Permalink
fix(nibi-dev): fetch test should pass when offline as well
Browse files Browse the repository at this point in the history
refactor(broker): remove unused code

commit 754be3c4f0f8561674a89f67cd6aafc8ddeaa26c
Merge: 40b95b0 f546e89
Author: Unique Divine <[email protected]>
Date:   Mon Mar 25 08:16:20 2024 +0900

    Merge branch 'main' into ud/perms

commit 40b95b0a38ab64bad222b9e44f9627ce9e4e29aa
Author: Unique Divine <[email protected]>
Date:   Sat Mar 23 18:25:18 2024 -0500

    fix(nibi-dev): fetch test should pass when offline as well

commit 49d93cd7b42b234050e348258a789cd52aeddd2a
Author: Unique Divine <[email protected]>
Date:   Sat Mar 23 18:25:01 2024 -0500

    refactor(broker): remove unused code

commit fca8548
Author: Unique Divine <[email protected]>
Date:   Fri Mar 22 04:36:53 2024 -0500

    fix(broker-staking): compilation issues and run tidy

commit 4b87403
Author: matthiasmatt <[email protected]>
Date:   Thu Mar 21 10:20:12 2024 +0100

    chore: doc

commit abf8865
Author: matthiasmatt <[email protected]>
Date:   Thu Mar 21 09:55:02 2024 +0100

    feat: update compounder to use broker-bank library

commit effd11b
Merge: 73f96b5 21dbc5c
Author: matthiasmatt <[email protected]>
Date:   Tue Mar 19 13:33:09 2024 +0100

    Merge remote-tracking branch 'origin/main' into mat/autocompounder

commit 73f96b5
Merge: 3209e9c 4b0444f
Author: matthiasmatt <[email protected]>
Date:   Tue Mar 19 13:29:37 2024 +0100

    fix: fix merge conflicts

commit 3209e9c
Author: matthiasmatt <[email protected]>
Date:   Thu Mar 7 18:51:56 2024 +0100

    fix: remove validation for nibivaloper adresses

commit 50a1130
Author: matthiasmatt <[email protected]>
Date:   Thu Mar 7 14:54:12 2024 +0100

    feat: update artifacts

commit e29f8a6
Merge: 36ca1fd 753f118
Author: matthiasmatt <[email protected]>
Date:   Thu Mar 7 14:54:06 2024 +0100

    Merge remote-tracking branch 'origin/main' into mat/autocompounder

commit 36ca1fd
Author: matthiasmatt <[email protected]>
Date:   Thu Feb 29 18:33:57 2024 +0100

    tests: add unit testing

commit 6af55fb
Author: matthiasmatt <[email protected]>
Date:   Thu Feb 29 14:14:45 2024 +0100

    feat: add core compounder contract
  • Loading branch information
Unique-Divine committed Mar 24, 2024
1 parent f546e89 commit f143dc9
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,4 +615,4 @@ We need to specify admin and managers
{
"admin_and_managers": {}
}
```
```
6 changes: 1 addition & 5 deletions contracts/broker-bank/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,6 @@ pub fn query(
QueryMsg::Ownership {} => {
Ok(to_json_binary(&cw_ownable::get_ownership(deps.storage)?)?)
}
QueryMsg::IsHalted {} => {
let is_halted = IS_HALTED.load(deps.storage)?;
Ok(to_json_binary(&is_halted)?)
}
}
}

Expand Down Expand Up @@ -798,4 +794,4 @@ pub mod tests {

Ok(())
}
}
}
3 changes: 0 additions & 3 deletions contracts/broker-bank/src/msgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ pub enum QueryMsg {
/// operator set is "halted".
#[returns(PermsStatus)]
Perms {},

#[returns(bool)]
IsHalted {},
}

#[cw_serde]
Expand Down
5 changes: 0 additions & 5 deletions contracts/broker-bank/src/oper_perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ pub struct HasPermsResponse {
pub perms: Permissions,
}

#[cw_serde]
pub struct PermsResponse {
pub perms: Permissions,
}

#[cw_serde]
pub struct Permissions {
pub owner: Option<String>,
Expand Down
6 changes: 1 addition & 5 deletions contracts/broker-staking/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn execute(
}
ExecuteMsg::ToggleHalt {} => toggle_halt(deps, env, info),
ExecuteMsg::UpdateOwnership(action) => {
execute_update_ownership(deps, env, info, action)
Ok(execute_update_ownership(deps, env, info, action)?)
}
ExecuteMsg::EditOpers(action) => edit_opers(deps, env, info, action),
ExecuteMsg::WithdrawAll { to } => {
Expand Down Expand Up @@ -171,9 +171,5 @@ pub fn query(
QueryMsg::Ownership {} => {
Ok(to_json_binary(&cw_ownable::get_ownership(deps.storage)?)?)
}
QueryMsg::IsHalted {} => {
let is_halted = IS_HALTED.load(deps.storage)?;
Ok(to_json_binary(&is_halted)?)
}
}
}
9 changes: 6 additions & 3 deletions contracts/broker-staking/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ use cosmwasm_std::Uint128;
#[cw_ownable::cw_ownable_execute]
#[cw_serde]
pub enum ExecuteMsg {
/// SetAutocompounderMode allows to set the autocompounder mode.
/// If it's set to true, managers will be able to stake tokens, otherwise
/// they won't be able to do so.
/// Toggles whether "operators" can invoke the smart contract. This acts a
/// security feature for the contract owner to disable non-owner permissions
/// quickly without sending multiple calls of `ExecuteMsg::EditOpers`.
///
/// When the smart contract is halted, the owner can still use the everything,
/// while operators cannot.
ToggleHalt {},

/// Withdraw coins from the broker smart contract balance. Only callable by
Expand Down
16 changes: 14 additions & 2 deletions packages/nibi-dev/src/gh_release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,27 @@ mod tests {

#[test]
fn api_version_is_not_stale() -> Result<(), anyhow::Error> {
gh_release::active_gh_api()?;
match gh_release::active_gh_api() {
Ok(_) => {}
Err(err) => {
// For when you're programming offline.
assert!(err.to_string().contains("failed to lookup address"))
}
};
Ok(())
}

#[test]
fn fetch_latest_releases() -> anyhow::Result<()> {
let repo_owner = "NibiruChain".to_string();
let repo_name = "nibiru".to_string();
gh_release::fetch_latest_releases(repo_owner, repo_name)?;
match gh_release::fetch_latest_releases(repo_owner, repo_name) {
Ok(_) => {}
Err(err) => {
// For when you're programming offline.
assert!(err.to_string().contains("failed to lookup address"))
}
};
Ok(())
}

Expand Down

0 comments on commit f143dc9

Please sign in to comment.