Skip to content

Commit

Permalink
Merge branch 'main' into merge/features_081223
Browse files Browse the repository at this point in the history
# Conflicts:
#	Cargo.lock
  • Loading branch information
epanchee committed Dec 8, 2023
2 parents d60c25e + 3b7c0c5 commit 002721f
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 99 deletions.
48 changes: 2 additions & 46 deletions .github/workflows/check_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,17 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true

jobs:
fetch_deps:
name: Fetch cargo dependencies
check-artifacts-size:
runs-on: ubuntu-latest

name: Check Artifacts Size
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GOV_PRIVATE_KEY }}
- uses: actions/cache@v3
if: always()
with:
path: |
~/.cargo/bin
~/.cargo/git/checkouts
~/.cargo/git/db
~/.cargo/registry/cache
~/.cargo/registry/index
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- run: |
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_governance.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_governance"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.68.0
override: true

- name: Fetch cargo deps
uses: actions-rs/cargo@v1
with:
command: fetch
args: --locked

check-artifacts-size:
runs-on: ubuntu-latest
name: Check Artifacts Size
needs: fetch_deps
steps:
- name: Checkout sources
uses: actions/checkout@v3

Expand All @@ -73,8 +31,6 @@ jobs:
~/.cargo/registry/cache
~/.cargo/registry/index
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# docker can't pull private sources, so we fail if cache is missing
fail-on-cache-miss: true

- name: Build Artifacts
run: |
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:
with:
access_token: ${{ github.token }}

- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GOV_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v2
- uses: actions/cache@v3
Expand All @@ -40,8 +35,6 @@ jobs:
~/.cargo/registry/index
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: |
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_governance.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_governance"

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:

env:
CARGO_TERM_COLOR: always
CARGO_NET_GIT_FETCH_WITH_CLI: true

jobs:
test_and_check:
Expand All @@ -21,12 +20,8 @@ jobs:
with:
access_token: ${{ github.token }}

- uses: actions/checkout@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GOV_PRIVATE_KEY }}
- name: Checkout sources
uses: actions/checkout@v3
- uses: actions/cache@v3
if: always()
with:
Expand All @@ -41,9 +36,6 @@ jobs:
restore-keys: |
${{ runner.os }}-cargo-
- run: |
git config url."ssh://[email protected]/astroport-fi/hidden_astroport_governance.git".insteadOf "https://github.com/astroport-fi/hidden_astroport_governance"
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ incremental = false
overflow-checks = true
strip = true

[patch.'https://github.com/astroport-fi/hidden_astroport_core']
astroport = { path = "packages/astroport" }

[patch.'https://github.com/astroport-fi/astroport-core']
astroport = { path = "packages/astroport" }

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Astroport Core

[![codecov](https://codecov.io/gh/astroport-fi/hidden_astroport_core/branch/main/graph/badge.svg?token=D8539UWBST)](https://codecov.io/gh/astroport-fi/hidden_astroport_core)
[![codecov](https://codecov.io/gh/astroport-fi/astroport-core/branch/main/graph/badge.svg?token=ROOLZTGZMM)](https://codecov.io/gh/astroport-fi/astroport-core)

Multi pool type automated market-maker (AMM) protocol powered by smart contracts on the [Terra](https://terra.money) blockchain.

Expand Down
46 changes: 22 additions & 24 deletions contracts/cw20_ics20/src/ibc.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
use astroport::outpost_handler::Cw20HookMsg;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use cosmwasm_schema::cw_serde;
use cosmwasm_std::{
attr, entry_point, from_binary, to_binary, BankMsg, Binary, CosmosMsg, Deps, DepsMut, Env,
IbcBasicResponse, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg,
IbcEndpoint, IbcOrder, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg,
IbcReceiveResponse, Reply, Response, SubMsg, SubMsgResult, Uint128, WasmMsg,
};
use cw20::Cw20ExecuteMsg;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use astroport::outpost_handler::Cw20HookMsg;

use crate::amount::Amount;
use crate::error::{ContractError, Never};
use crate::state::{
reduce_channel_balance, undo_reduce_channel_balance, ChannelInfo, ReplyArgs, ALLOW_LIST,
CHANNEL_INFO, CONFIG, REPLY_ARGS,
};
use cw20::Cw20ExecuteMsg;

pub const ICS20_VERSION: &str = "ics20-1";
pub const ICS20_ORDERING: IbcOrder = IbcOrder::Unordered;
Expand Down Expand Up @@ -488,15 +488,17 @@ fn send_amount(amount: Amount, recipient: String) -> CosmosMsg {

#[cfg(test)]
mod test {
use super::*;
use crate::test_helpers::*;
use cosmwasm_std::testing::{mock_env, mock_info};
use cosmwasm_std::{coins, to_vec, IbcEndpoint, IbcMsg, IbcTimeout, Timestamp};
use cw20::Cw20ReceiveMsg;

use astroport::cw20_ics20::TransferMsg;

use crate::contract::{execute, migrate, query_channel};
use crate::msg::{ExecuteMsg, MigrateMsg};
use astroport::cw20_ics20::TransferMsg;
use cosmwasm_std::testing::{mock_env, mock_info};
use cosmwasm_std::{coins, to_vec, Addr, IbcEndpoint, IbcMsg, IbcTimeout, Timestamp};
use cw20::Cw20ReceiveMsg;
use crate::test_helpers::*;

use super::*;

#[test]
fn check_ack_json() {
Expand Down Expand Up @@ -586,10 +588,6 @@ mod test {
)
}

fn mock_relayer_addr() -> Addr {
Addr::unchecked("relayer")
}

#[test]
fn send_receive_cw20() {
let send_channel = "channel-9";
Expand All @@ -608,7 +606,7 @@ mod test {
mock_receive_packet(send_channel, 1876543210, cw20_denom, "local-rcpt", None);

// cannot receive this denom yet
let msg = IbcPacketReceiveMsg::new(recv_packet.clone(), mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_packet.clone());
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert!(res.messages.is_empty());
let ack: Ics20Ack = from_binary(&res.acknowledgement).unwrap();
Expand Down Expand Up @@ -653,14 +651,14 @@ mod test {
assert_eq!(state.total_sent, vec![Amount::cw20(987654321, cw20_addr)]);

// cannot receive more than we sent
let msg = IbcPacketReceiveMsg::new(recv_high_packet, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_high_packet);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert!(res.messages.is_empty());
let ack: Ics20Ack = from_binary(&res.acknowledgement).unwrap();
assert_eq!(ack, no_funds);

// we can receive less than we sent
let msg = IbcPacketReceiveMsg::new(recv_packet, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_packet);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert_eq!(1, res.messages.len());
assert_eq!(
Expand Down Expand Up @@ -703,7 +701,7 @@ mod test {
mock_receive_packet(send_channel, 1876543210, cw20_denom, "local-rcpt", None);

// cannot receive this denom yet
let msg = IbcPacketReceiveMsg::new(recv_packet, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_packet);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert!(res.messages.is_empty());
let ack: Ics20Ack = from_binary(&res.acknowledgement).unwrap();
Expand Down Expand Up @@ -748,14 +746,14 @@ mod test {
assert_eq!(state.total_sent, vec![Amount::cw20(987654321, cw20_addr)]);

// cannot receive more than we sent
let msg = IbcPacketReceiveMsg::new(recv_high_packet, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_high_packet);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert!(res.messages.is_empty());
let ack: Ics20Ack = from_binary(&res.acknowledgement).unwrap();
assert_eq!(ack, no_funds);

// We can receive less than we sent, but if a memo is set without a handler, we fail
let msg = IbcPacketReceiveMsg::new(recv_packet_with_memo, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_packet_with_memo);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();

// No messages should be sent
Expand Down Expand Up @@ -784,7 +782,7 @@ mod test {
mock_receive_packet(send_channel, 1876543210, denom, "local-rcpt", None);

// cannot receive this denom yet
let msg = IbcPacketReceiveMsg::new(recv_packet.clone(), mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_packet.clone());
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert!(res.messages.is_empty());
let ack: Ics20Ack = from_binary(&res.acknowledgement).unwrap();
Expand All @@ -807,14 +805,14 @@ mod test {
assert_eq!(state.total_sent, vec![Amount::native(987654321, denom)]);

// cannot receive more than we sent
let msg = IbcPacketReceiveMsg::new(recv_high_packet, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_high_packet);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert!(res.messages.is_empty());
let ack: Ics20Ack = from_binary(&res.acknowledgement).unwrap();
assert_eq!(ack, no_funds);

// we can receive less than we sent
let msg = IbcPacketReceiveMsg::new(recv_packet, mock_relayer_addr());
let msg = IbcPacketReceiveMsg::new(recv_packet);
let res = ibc_packet_receive(deps.as_mut(), mock_env(), msg).unwrap();
assert_eq!(1, res.messages.len());
assert_eq!(
Expand Down
2 changes: 1 addition & 1 deletion contracts/pair_concentrated_inj/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ anyhow = "1.0"
derivative = "2.2"
astroport-native-coin-registry = { path = "../periphery/native_coin_registry" }
injective-math = "0.1"
injective-testing = "0.1"
injective-testing = "0.1.1"
10 changes: 5 additions & 5 deletions contracts/tokenomics/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ backtraces = ["cosmwasm-std/backtraces"]
cw-storage-plus = "0.15"
cw1-whitelist = { version = "0.15", features = ["library"] }
thiserror = { version = "1.0" }
astroport-governance = { git = "https://github.com/astroport-fi/hidden_astroport_governance", version = "1" }
astroport-governance = { git = "https://github.com/astroport-fi/astroport-governance", version = "1" }
protobuf = { version = "2", features = ["with-bytes"] }
cosmwasm-std = "1.1"
cw2 = "0.15"
Expand All @@ -33,7 +33,7 @@ cosmwasm-schema = "1.1"
cw-utils = "1.0.1"

[dev-dependencies]
generator-controller = { git = "https://github.com/astroport-fi/hidden_astroport_governance", branch = "main" }
generator-controller = { git = "https://github.com/astroport-fi/astroport-governance" }
astroport-mocks = { path = "../../../packages/astroport_mocks" }
astroport-token = { path = "../../token" }
astroport-vesting = { path = "../vesting" }
Expand All @@ -43,9 +43,9 @@ astroport-pair = { path = "../../pair" }
astroport-pair-stable = { path = "../../pair_stable" }
astroport-whitelist = { path = "../../whitelist" }
anyhow = "1"
voting-escrow = { git = "https://github.com/astroport-fi/hidden_astroport_governance", branch = "main" }
voting-escrow-delegation = { git = "https://github.com/astroport-fi/hidden_astroport_governance", branch = "main" }
astroport-nft = { git = "https://github.com/astroport-fi/hidden_astroport_governance", branch = "main" }
voting-escrow = { git = "https://github.com/astroport-fi/astroport-governance" }
voting-escrow-delegation = { git = "https://github.com/astroport-fi/astroport-governance" }
astroport-nft = { git = "https://github.com/astroport-fi/astroport-governance" }
cw721-base = { version = "0.15", features = ["library"] }
generator-proxy-to-vkr = { git = "https://github.com/astroport-fi/astro-generator-proxy-contracts", branch = "main" }
valkyrie = { git = "https://github.com/astroport-fi/valkyrieprotocol", rev = "b5fcb666f17d7e291f40365756e50fc0d7b9bf54" }
Expand Down
4 changes: 2 additions & 2 deletions contracts/tokenomics/maker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ astroport-factory = { path = "../../factory" }
astroport-pair = { path = "../../pair" }
cw-multi-test = "0.15"
astroport-pair-stable = { path = "../../pair_stable" }
astroport-governance = { git = "https://github.com/astroport-fi/hidden_astroport_governance", branch = "main" }
astroport-escrow-fee-distributor = { git = "https://github.com/astroport-fi/hidden_astroport_governance", branch = "main" }
astroport-governance = { git = "https://github.com/astroport-fi/astroport-governance" }
astroport-escrow-fee-distributor = { git = "https://github.com/astroport-fi/astroport-governance" }
astroport-native-coin-registry = { path = "../../periphery/native_coin_registry" }

0 comments on commit 002721f

Please sign in to comment.