Skip to content

Commit

Permalink
Duality Swap Adapter Fixes (#155)
Browse files Browse the repository at this point in the history
* adaptor fixes

* remove unused tests and update old tests

* clippy

* give larger amount buffer

* fmt

* amount_out check

* fix clippy

* run make fmt

* run make schema

---------

Co-authored-by: Jeremy Liu <[email protected]>
  • Loading branch information
NicholasDotSol and NotJeremyLiu authored Jan 9, 2025
1 parent e23f8d8 commit dc3f516
Show file tree
Hide file tree
Showing 30 changed files with 305 additions and 563 deletions.
25 changes: 23 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions contracts/adapters/hyperlane/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> ContractResult<Resp
))
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

// Contract name and version used for migration.
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
Expand Down
12 changes: 6 additions & 6 deletions contracts/adapters/ibc/ibc-hooks/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> ContractResult<Resp
))
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

// Contract name and version used for migration.
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
Expand Down Expand Up @@ -275,9 +275,9 @@ pub fn sudo(deps: DepsMut, env: Env, msg: SudoMsg) -> ContractResult<Response> {
.add_attribute("action", sudo_type))
}

////////////////////////
/// HELPER FUNCTIONS ///
////////////////////////
//////////////////////
// HELPER FUNCTIONS //
//////////////////////

// Verifies the given memo is empty or valid json, and then adds the necessary
// key/value pair to trigger the ibc hooks callback logic.
Expand Down
12 changes: 6 additions & 6 deletions contracts/adapters/ibc/neutron-transfer/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> ContractResult<Re
unimplemented!()
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

// Contract name and version used for migration.
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
Expand Down Expand Up @@ -225,9 +225,9 @@ pub fn sudo(deps: DepsMut, env: Env, msg: TransferSudoMsg) -> ContractResult<Res
.add_attribute("action", sudo_type))
}

////////////////////////
/// HELPER FUNCTIONS ///
////////////////////////
//////////////////////
// HELPER FUNCTIONS //
//////////////////////

// Helper function to get the ack_id (channel id, sequence id) from a RequestPacket
fn get_ack_id(req: &RequestPacket) -> ContractResult<AckID> {
Expand Down
12 changes: 6 additions & 6 deletions contracts/adapters/swap/astroport/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub fn migrate(deps: DepsMut, _env: Env, msg: MigrateMsg) -> ContractResult<Resp
))
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn instantiate(
Expand All @@ -79,9 +79,9 @@ pub fn instantiate(
))
}

///////////////
/// RECEIVE ///
///////////////
/////////////
// RECEIVE //
/////////////

// Receive is the main entry point for the contract to
// receive cw20 tokens and execute the swap
Expand Down
12 changes: 6 additions & 6 deletions contracts/adapters/swap/astrovault/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ pub fn migrate(deps: DepsMut, _env: Env, _msg: MigrateMsg) -> ContractResult<Res
Ok(Response::default())
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

#[cfg_attr(not(feature = "library"), entry_point)]
pub fn instantiate(
Expand Down Expand Up @@ -90,9 +90,9 @@ pub fn instantiate(
))
}

///////////////
/// RECEIVE ///
///////////////
/////////////
// RECEIVE //
/////////////

// Receive is the main entry point for the contract to
// receive cw20 tokens and execute the swap
Expand Down
12 changes: 6 additions & 6 deletions contracts/adapters/swap/dexter/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> ContractResult<Re
unimplemented!()
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

// Contract name and version used for migration.
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
Expand Down Expand Up @@ -79,9 +79,9 @@ pub fn instantiate(
))
}

///////////////
/// RECEIVE ///
///////////////
/////////////
// RECEIVE //
/////////////

// Receive is the main entry point for the contract to
// receive cw20 tokens and execute the swap
Expand Down
6 changes: 3 additions & 3 deletions contracts/adapters/swap/drop/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> ContractResult<Re
unimplemented!()
}

///////////////////
/// INSTANTIATE ///
///////////////////
/////////////////
// INSTANTIATE //
/////////////////

// Contract name and version used for migration.
const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME");
Expand Down
2 changes: 1 addition & 1 deletion contracts/adapters/swap/duality/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ backtraces = ["cosmwasm-std/backtraces"]
library = []

[dependencies]
neutron-sdk = "0.10.0"
neutron-sdk = { git = "https://github.com/neutron-org/neutron-sdk", branch = "patch/sim_requests"}
cosmwasm-schema = { workspace = true }
cosmwasm-std = { workspace = true }
cw2 = { workspace = true }
Expand Down
Loading

0 comments on commit dc3f516

Please sign in to comment.