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

chore(CL): merge main into concentrated-liquidity-main #3211

Merged
merged 38 commits into from
Nov 2, 2022
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
42d73f1
Add servers to openapi spec file (#2980)
daniel-farina Oct 19, 2022
ec7a7a8
Chain.schema.json: Added ibc data, fix genesis name, formatting (#3077)
JeremyParish69 Oct 20, 2022
fdbdc78
labels (#3082)
czarcas7ic Oct 21, 2022
4a67cdd
[x/gamm][stableswap]: Expand inverse relation tests to multi assets a…
AlpinYukseloglu Oct 21, 2022
d812334
remove all uses of two-asset binary search solver (#3084)
AlpinYukseloglu Oct 21, 2022
edfb19b
[stableswap]: Implement simplified direct multi-asset CFMM solver (#3…
AlpinYukseloglu Oct 21, 2022
c51a248
refactor: remove PokePool from the PoolI interface, define on extensi…
p0mvn Oct 21, 2022
f0f31d0
ci(CL): run tests on CL branch and add backport config (#3095)
p0mvn Oct 21, 2022
7f62b6d
After create pool test (#2783)
hieuvubk Oct 22, 2022
b552bab
fix GetModuleToDistributeCoins (#2957)
catShaark Oct 24, 2022
975aeb9
update comment in gamm module (#3103)
ThanhNhann Oct 24, 2022
9176a51
chore(deps): Bump github.com/tendermint/tendermint (#3106)
dependabot[bot] Oct 24, 2022
18f4afa
chore(deps): Bump github.com/golangci/golangci-lint (#3104)
dependabot[bot] Oct 24, 2022
6548902
chore(deps): Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 (#3…
dependabot[bot] Oct 24, 2022
7119419
chore: update concentrated liquidity backport label (#3115)
p0mvn Oct 24, 2022
8590b80
feat(osmomath): log2 approximation (#2788)
p0mvn Oct 24, 2022
ced84c1
[stableswap]: Cap number of assets and post-scaled asset amounts to e…
AlpinYukseloglu Oct 24, 2022
0aa0263
Remove unused versions in mergify (#3121)
niccoloraspa Oct 24, 2022
df9102e
Query lockup params (#3098)
hieuvubk Oct 24, 2022
6274617
CI: Delete failing step (#3124)
ValarDragon Oct 24, 2022
184a85c
[x/gamm][stableswap]: Add inverse join/exit tests, fix single asset j…
AlpinYukseloglu Oct 24, 2022
805f80c
Stableswap implement JoinPoolNoSwap (#2942)
ValarDragon Oct 24, 2022
2ce796c
Make testing suite to ensure queries never alter state (#3001)
hieuvubk Oct 25, 2022
1e80a2a
Remove streamswap (#3146)
hieuvubk Oct 25, 2022
20c72cc
updated the contract to cosmwasm 1.1 and Uint256 for amounts (#2950)
nicolaslara Oct 29, 2022
46d0053
chore: use environment variable instead of build tags to control e2e …
p0mvn Oct 31, 2022
bb5c1c9
Rate limit - Cleaner tests (#3183)
nicolaslara Oct 31, 2022
d8b6d54
changed lints to stable so they change less often (#3184)
nicolaslara Oct 31, 2022
5abf7a4
update version numbers (#3168)
doggystylez Oct 31, 2022
434b42f
chore(deps): Bump github.com/spf13/cobra from 1.6.0 to 1.6.1 (#3187)
dependabot[bot] Oct 31, 2022
a3d0110
chore(deps): Bump github.com/mattn/go-sqlite3 from 1.14.15 to 1.14.16…
dependabot[bot] Oct 31, 2022
5c9bc1b
chore(e2e): add vscode debug configurations (#3180)
p0mvn Oct 31, 2022
5c408f9
osmomath(log/CL): ln(x), log_1.0001(x), log_custom(x) (#3169)
pysel Nov 1, 2022
8cd07fd
feat(release): Automated post-upgrade tasks by code generating upgrad…
pysel Nov 1, 2022
2620afd
chore: Tx post-handler example snippet #3194
alexanderbez Nov 1, 2022
d874d6d
Progress on IBC rate limit spec (#3190)
ValarDragon Nov 1, 2022
29c8561
fix(e2e): various e2e build issues breaking debugging on linux amd64 …
p0mvn Nov 2, 2022
a7acb4f
Merge branch 'main' into roman/merge-main
p0mvn Nov 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
updated the contract to cosmwasm 1.1 and Uint256 for amounts (#2950)
nicolaslara authored Oct 29, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 20c72cced1696418046ffe43ff0d0b859e1397bf
17 changes: 3 additions & 14 deletions x/ibc-rate-limit/contracts/rate-limiter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -15,17 +15,6 @@ exclude = [
[lib]
crate-type = ["cdylib", "rlib"]

[profile.release]
opt-level = 3
debug = false
rpath = false
lto = true
debug-assertions = false
codegen-units = 1
panic = 'abort'
incremental = false
overflow-checks = true

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
@@ -43,14 +32,14 @@ optimize = """docker run --rm -v "$(pwd)":/code \
"""

[dependencies]
cosmwasm-std = "1.0.0"
cosmwasm-storage = "1.0.0"
cosmwasm-std = "1.1.0"
cosmwasm-storage = "1.1.0"
cosmwasm-schema = "1.1.0"
cw-storage-plus = "0.13.2"
cw2 = "0.13.2"
schemars = "0.8.8"
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.31" }

[dev-dependencies]
cosmwasm-schema = "1.0.0"
cw-multi-test = "0.13.2"
13 changes: 13 additions & 0 deletions x/ibc-rate-limit/contracts/rate-limiter/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use cosmwasm_schema::write_api;

use rate_limiter::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg, SudoMsg};

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
sudo: SudoMsg,
migrate: MigrateMsg,
}
}
71 changes: 37 additions & 34 deletions x/ibc-rate-limit/contracts/rate-limiter/src/contract_tests.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

use crate::{contract::*, ContractError};
use cosmwasm_std::testing::{mock_dependencies, mock_env, mock_info};
use cosmwasm_std::{from_binary, Addr, Attribute};
use cosmwasm_std::{from_binary, Addr, Attribute, Uint256};

use crate::helpers::tests::verify_query_response;
use crate::msg::{InstantiateMsg, PathMsg, QueryMsg, QuotaMsg, SudoMsg};
@@ -52,8 +52,8 @@ fn consume_allowance() {
let msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 300,
channel_value: 3_000_u32.into(),
funds: 300_u32.into(),
};
let res = sudo(deps.as_mut(), mock_env(), msg).unwrap();

@@ -64,8 +64,8 @@ fn consume_allowance() {
let msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 300,
channel_value: 3_000_u32.into(),
funds: 300_u32.into(),
};
let err = sudo(deps.as_mut(), mock_env(), msg).unwrap_err();
assert!(matches!(err, ContractError::RateLimitExceded { .. }));
@@ -91,14 +91,14 @@ fn symetric_flows_dont_consume_allowance() {
let send_msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 300,
channel_value: 3_000_u32.into(),
funds: 300_u32.into(),
};
let recv_msg = SudoMsg::RecvPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 300,
channel_value: 3_000_u32.into(),
funds: 300_u32.into(),
};

let res = sudo(deps.as_mut(), mock_env(), send_msg.clone()).unwrap();
@@ -154,8 +154,8 @@ fn asymetric_quotas() {
let msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 60,
channel_value: 3_000_u32.into(),
funds: 60_u32.into(),
};
let res = sudo(deps.as_mut(), mock_env(), msg).unwrap();
let Attribute { key, value } = &res.attributes[4];
@@ -166,8 +166,8 @@ fn asymetric_quotas() {
let msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 60,
channel_value: 3_000_u32.into(),
funds: 60_u32.into(),
};

let res = sudo(deps.as_mut(), mock_env(), msg).unwrap();
@@ -180,8 +180,8 @@ fn asymetric_quotas() {
let recv_msg = SudoMsg::RecvPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 30,
channel_value: 3_000_u32.into(),
funds: 30_u32.into(),
};
let res = sudo(deps.as_mut(), mock_env(), recv_msg).unwrap();
let Attribute { key, value } = &res.attributes[3];
@@ -195,8 +195,8 @@ fn asymetric_quotas() {
let msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 60,
channel_value: 3_000_u32.into(),
funds: 60_u32.into(),
};
let err = sudo(deps.as_mut(), mock_env(), msg.clone()).unwrap_err();
assert!(matches!(err, ContractError::RateLimitExceded { .. }));
@@ -205,8 +205,8 @@ fn asymetric_quotas() {
let msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 30,
channel_value: 3_000_u32.into(),
funds: 30_u32.into(),
};
let res = sudo(deps.as_mut(), mock_env(), msg.clone()).unwrap();
let Attribute { key, value } = &res.attributes[3];
@@ -246,8 +246,8 @@ fn query_state() {
assert_eq!(value[0].quota.max_percentage_send, 10);
assert_eq!(value[0].quota.max_percentage_recv, 10);
assert_eq!(value[0].quota.duration, RESET_TIME_WEEKLY);
assert_eq!(value[0].flow.inflow, 0);
assert_eq!(value[0].flow.outflow, 0);
assert_eq!(value[0].flow.inflow, Uint256::from(0_u32));
assert_eq!(value[0].flow.outflow, Uint256::from(0_u32));
assert_eq!(
value[0].flow.period_end,
env.block.time.plus_seconds(RESET_TIME_WEEKLY)
@@ -256,16 +256,16 @@ fn query_state() {
let send_msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 300,
channel_value: 3_000_u32.into(),
funds: 300_u32.into(),
};
sudo(deps.as_mut(), mock_env(), send_msg.clone()).unwrap();

let recv_msg = SudoMsg::RecvPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 30,
channel_value: 3_000_u32.into(),
funds: 30_u32.into(),
};
sudo(deps.as_mut(), mock_env(), recv_msg.clone()).unwrap();

@@ -277,8 +277,8 @@ fn query_state() {
"weekly",
(10, 10),
RESET_TIME_WEEKLY,
30,
300,
30_u32.into(),
300_u32.into(),
env.block.time.plus_seconds(RESET_TIME_WEEKLY),
);
}
@@ -317,8 +317,8 @@ fn bad_quotas() {
"bad_quota",
(100, 100),
200,
0,
0,
0_u32.into(),
0_u32.into(),
env.block.time.plus_seconds(200),
);
}
@@ -343,21 +343,24 @@ fn undo_send() {
let send_msg = SudoMsg::SendPacket {
channel_id: format!("channel"),
denom: format!("denom"),
channel_value: 3_000,
funds: 300,
channel_value: 3_000_u32.into(),
funds: 300_u32.into(),
};
let undo_msg = SudoMsg::UndoSend {
channel_id: format!("channel"),
denom: format!("denom"),
funds: 300,
funds: 300_u32.into(),
};

sudo(deps.as_mut(), mock_env(), send_msg.clone()).unwrap();

let trackers = RATE_LIMIT_TRACKERS
.load(&deps.storage, ("channel".to_string(), "denom".to_string()))
.unwrap();
assert_eq!(trackers.first().unwrap().flow.outflow, 300);
assert_eq!(
trackers.first().unwrap().flow.outflow,
Uint256::from(300_u32)
);
let period_end = trackers.first().unwrap().flow.period_end;
let channel_value = trackers.first().unwrap().quota.channel_value;

@@ -366,7 +369,7 @@ fn undo_send() {
let trackers = RATE_LIMIT_TRACKERS
.load(&deps.storage, ("channel".to_string(), "denom".to_string()))
.unwrap();
assert_eq!(trackers.first().unwrap().flow.outflow, 0);
assert_eq!(trackers.first().unwrap().flow.outflow, Uint256::from(0_u32));
assert_eq!(trackers.first().unwrap().flow.period_end, period_end);
assert_eq!(trackers.first().unwrap().quota.channel_value, channel_value);
}
12 changes: 6 additions & 6 deletions x/ibc-rate-limit/contracts/rate-limiter/src/execute.rs
Original file line number Diff line number Diff line change
@@ -159,8 +159,8 @@ mod tests {
"daily",
(3, 5),
1600,
0,
0,
0_u32.into(),
0_u32.into(),
env.block.time.plus_seconds(1600),
);

@@ -208,8 +208,8 @@ mod tests {
"daily",
(3, 5),
1600,
0,
0,
0_u32.into(),
0_u32.into(),
env.block.time.plus_seconds(1600),
);

@@ -241,8 +241,8 @@ mod tests {
"different",
(50, 30),
5000,
0,
0,
0_u32.into(),
0_u32.into(),
env.block.time.plus_seconds(5000),
);
}
6 changes: 3 additions & 3 deletions x/ibc-rate-limit/contracts/rate-limiter/src/helpers.rs
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ impl RateLimitingContract {
}

pub mod tests {
use cosmwasm_std::Timestamp;
use cosmwasm_std::{Timestamp, Uint256};

use crate::state::RateLimit;

@@ -46,8 +46,8 @@ pub mod tests {
quota_name: &str,
send_recv: (u32, u32),
duration: u64,
inflow: u128,
outflow: u128,
inflow: Uint256,
outflow: Uint256,
period_end: Timestamp,
) {
assert_eq!(value.quota.name, quota_name);
Loading