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

Implement Valence and Astroport Utils #1

Merged
merged 74 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
5db1c8a
Create TestContext.
dowlandaiello Jun 24, 2024
4b896ac
Create a neutron example.
dowlandaiello Jun 25, 2024
7c8a209
Get create_auction working.
dowlandaiello Jun 25, 2024
90c1677
Add utility mehods for creating astroport pools.
dowlandaiello Jun 26, 2024
eabe38c
Finish get_pool implementation.
dowlandaiello Jun 26, 2024
3050aba
Create github action.
dowlandaiello Jun 26, 2024
c0766ca
Fix test path.
dowlandaiello Jun 26, 2024
d7d4844
Rename all create functions to tx_create.
dowlandaiello Jun 26, 2024
334b352
Add methods for funding auctions and starting auctions.
dowlandaiello Jun 26, 2024
8fdf576
Add fund astroport pool helpers.
dowlandaiello Jun 26, 2024
21c4760
Use with_ prefix for builder methods.
dowlandaiello Jun 27, 2024
9c00a7a
Migrate astroport functions from serde_json::value to canonical vals.
dowlandaiello Jun 27, 2024
52b0c78
Fix API conformance issues in example after previous commit.
dowlandaiello Jun 27, 2024
47611c6
Update astroport contracts.
dowlandaiello Jun 27, 2024
65b6ce2
Add ConfigChainBuilder defaults for stride, neutron, osmosis.
dowlandaiello Jun 27, 2024
afcf3bc
Use defaut API port.
dowlandaiello Jun 27, 2024
2ca08e1
Builder-ify many txs.
dowlandaiello Jun 27, 2024
df3c1c8
Use with_offer_asset instead of with_pair.
dowlandaiello Jun 27, 2024
483b9b2
Fix an incorrect builder method.
dowlandaiello Jun 27, 2024
e1e2277
Finish builder migration.
dowlandaiello Jun 27, 2024
982c7f5
Remove an extraneous println.
dowlandaiello Jun 27, 2024
88cb030
Attach proper denom quantities to funding tx.
dowlandaiello Jun 28, 2024
3773ed6
See previous.
dowlandaiello Jun 28, 2024
f155eb8
Add methods for minting tokens.
dowlandaiello Jun 28, 2024
b1f7d97
Finish mint tokenfactory token impl.
dowlandaiello Jun 28, 2024
0c04b55
Increase gas for providing liquidity.
dowlandaiello Jun 28, 2024
146a6fc
Increase all gas limits.
dowlandaiello Jun 28, 2024
77011bc
Add a setter for block delta.
dowlandaiello Jun 28, 2024
12d3c4d
Use new end_block_delta option in neutron.rs.
dowlandaiello Jun 28, 2024
b79a9ca
Inline all exec() error logs.
dowlandaiello Jun 28, 2024
5114992
Add price orable utils.
dowlandaiello Jun 28, 2024
2724ef3
Allow another logs format for get_tx_events.
dowlandaiello Jun 28, 2024
99db25f
Migrate from chain id's to chain names.
dowlandaiello Jun 28, 2024
ad05068
Add slippage tolerance to LP builder.
dowlandaiello Jun 28, 2024
dd193a3
Rename get_tx_events to get_tx_errors.
dowlandaiello Jun 28, 2024
89d98f3
Debugging github actions.
dowlandaiello Jun 28, 2024
6421c25
Being ratelimited.
dowlandaiello Jun 28, 2024
09da67b
Add an option for skipping logs unwrapping.
dowlandaiello Jun 29, 2024
3384024
Pin localic-std.
dowlandaiello Jun 29, 2024
58cef7e
Start working on osmosis helper functions.
dowlandaiello Jun 29, 2024
03c52d7
Fix pool creation.
dowlandaiello Jun 29, 2024
b3d0295
Start working on IBC transfer.
dowlandaiello Jun 29, 2024
3a9b509
Add a flake file.
dowlandaiello Jun 29, 2024
9cf3717
Run IBC tests in GH action.
dowlandaiello Jun 29, 2024
ea127b8
Fix ibc transfers.
dowlandaiello Jun 30, 2024
bd76216
Send funds for initial deposit alongside create pool tx.
dowlandaiello Jun 30, 2024
fe2af3d
Send tokens with create pool tx.
dowlandaiello Jun 30, 2024
3f11d4e
Don't send funds alongside pool creation.
dowlandaiello Jun 30, 2024
08f4184
Revert "Don't send funds alongside pool creation."
dowlandaiello Jun 30, 2024
8cd95b6
Reapply "Don't send funds alongside pool creation."
dowlandaiello Jun 30, 2024
ea682d0
Implement ibc transfers.
dowlandaiello Jun 30, 2024
85bf346
Implement get osmo pool.
dowlandaiello Jun 30, 2024
1b47899
Fix osmosis tx receipt guarding.
dowlandaiello Jul 1, 2024
9f34ad5
Only include recipient if the user specifies it in mint tx.
dowlandaiello Jul 1, 2024
1b33ab8
Guard tokenfactory txs.
dowlandaiello Jul 1, 2024
387251d
Guard more txs.
dowlandaiello Jul 1, 2024
2c69266
Use proper chain name when unwrapping logs for tokenfactory tx.
dowlandaiello Jul 1, 2024
3f8504c
Unwrap logs for osmosis pool creation.
dowlandaiello Jul 1, 2024
354b997
Separate test jobs into separate jobs.
dowlandaiello Jul 1, 2024
ba1745b
Rename a job.
dowlandaiello Jul 1, 2024
0867b54
Fix denom get function.
dowlandaiello Jul 1, 2024
46e4303
Update neutron osmosis tests to make pools.
dowlandaiello Jul 1, 2024
78b5a32
Fix get ibc denom helper function.
dowlandaiello Jul 1, 2024
840d5f1
Gitignore logs.json.
dowlandaiello Jul 1, 2024
6df58fc
Use addrs consistent with other chain configs.
dowlandaiello Jul 1, 2024
e74aeb3
Update src/utils/test_context.rs
dowlandaiello Jul 1, 2024
21de788
Remove some errors from fixtures.rx.
dowlandaiello Jul 1, 2024
696ea78
Update addresses in osmo test.
dowlandaiello Jul 1, 2024
3c16ad3
Add a helper for getting an IBC trace.
dowlandaiello Jul 1, 2024
f5b4632
Add a trace type to ibc.
dowlandaiello Jul 1, 2024
a991fc2
Add dest denoms to ibc trace type.
dowlandaiello Jul 1, 2024
f5b2800
Use Keyne's ibc channel lookup logic.
dowlandaiello Jul 2, 2024
d26c395
IBC denom get fix: denoms are calculated using src denoms.
dowlandaiello Jul 2, 2024
52f0f79
Unwind denoms in get_ibc_denom.
dowlandaiello Jul 2, 2024
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
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Test Localic-utils

on: [push]

env:
GO_VERSION: 1.21

jobs:
neutron-int-test:
name: Neutron integration test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install local-ic
run: cd examples && git clone https://github.com/strangelove-ventures/interchaintest.git && cd interchaintest/local-interchain && make install

- name: Get cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Run neutron example
run: cd examples && local-ic start neutron_gaia --api-port 42069 & curl --head -X GET --retry 200 --retry-connrefused --retry-delay 1 http://localhost:42069 && cd examples && cargo run --example neutron
neutron-osmosis-int-test:
name: Neutron-Osmosis integration test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install local-ic
run: cd examples && git clone https://github.com/strangelove-ventures/interchaintest.git && cd interchaintest/local-interchain && make install

- name: Get cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Run neutron-osmosis example
run: cd examples && local-ic start neutron_gaia --api-port 42069 & curl --head -X GET --retry 200 --retry-connrefused --retry-delay 1 http://localhost:42069 && cd examples && cargo run --example neutron_osmosis
osmosis-int-test:
name: Osmosis integration test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Install local-ic
run: cd examples && git clone https://github.com/strangelove-ventures/interchaintest.git && cd interchaintest/local-interchain && make install

- name: Get cargo
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Run osmosis example
run: cd examples && local-ic start neutron_gaia --api-port 42069 & curl --head -X GET --retry 200 --retry-connrefused --retry-delay 1 http://localhost:42069 && cd examples && cargo run --example osmosis
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,13 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb


# Added by cargo

/target

# Generated by emacs
*~

examples/configs/logs.json
18 changes: 18 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "localic-utils"

Choose a reason for hiding this comment

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

@uditvira do we want to have either a timewave or valance prefix for the crate name ?

version = "0.1.0"
edition = "2021"

[dependencies]
localic-std = { git = "https://github.com/strangelove-ventures/interchaintest", rev = "f326371" }
cosmwasm-std = "1.5.4"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
thiserror = "1.0"
derive_builder = "0.20.0"
log = "0.4.21"
astroport = "5.1.0"
reqwest = { version = "0.11.20", features = ["rustls-tls"] }

[dev-dependencies]
env_logger = "0.11.3"
15 changes: 15 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# localic-utils examples

To run the examples:

## Start local-interchain

```bash
local-ic start <example_chain> --api-port 42069
```

## Run the eample

```bash
cargo run --example <example_name>
```
206 changes: 206 additions & 0 deletions examples/chains/neutron_gaia.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
{
"chains": [
{
"name": "gaia",
"chain_id": "localcosmos-1",
"denom": "uatom",
"binary": "gaiad",
"bech32_prefix": "cosmos",
"docker_image": {
"version": "v15.0.0-rc2"
},
"gas_prices": "0%DENOM%",
"chain_type": "cosmos",
"coin_type": 118,
"trusting_period": "336h",
"gas_adjustment": 2.0,
"number_vals": 1,
"number_node": 0,
"ibc_paths": [],
"debugging": true,
"block_time": "500ms",
"host_port_override": {
"26657": "26658",
"1317": "1318",
"9090": "9091"
},
"genesis": {
"modify": [
{
"key": "app_state.gov.params.voting_period",
"value": "3s"
},
{
"key": "app_state.interchainaccounts.host_genesis_state.params.allow_messages",
"value": [
"/cosmos.bank.v1beta1.MsgSend",
"/cosmos.bank.v1beta1.MsgMultiSend",
"/cosmos.staking.v1beta1.MsgDelegate",
"/cosmos.staking.v1beta1.MsgUndelegate",
"/cosmos.staking.v1beta1.MsgBeginRedelegate",
"/cosmos.staking.v1beta1.MsgRedeemTokensforShares",
"/cosmos.staking.v1beta1.MsgTokenizeShares",
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
"/ibc.applications.transfer.v1.MsgTransfer"
]
}
],
"accounts": [
{
"name": "acc0",
"address": "cosmos1hj5fveer5cjtn4wd6wstzugjfdxzl0xpxvjjvr",
"amount": "20000000000%DENOM%",
"mnemonic": "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
}
]
}
},
{
"name": "neutron",
"chain_id": "localneutron-1",
"denom": "untrn",
"binary": "neutrond",
"bech32_prefix": "neutron",
"docker_image": {
"version": "v3.0.4",
"repository": "ghcr.io/strangelove-ventures/heighliner/neutron"
},
"gas_prices": "0.0untrn,0.0uatom",
"chain_type": "cosmos",
"coin_type": 118,
"trusting_period": "336h",
"gas_adjustment": 1.3,
"number_vals": 1,
"number_node": 0,
"ics_consumer_link": "localcosmos-1",
"ibc_paths": ["neutron-osmosis"],
"debugging": true,
"block_time": "500ms",
"host_port_override": {
"26657": "26657",
"1317": "1317",
"9090": "9090"
},
"genesis": {
"modify": [
{
"key": "consensus_params.block.max_gas",
"value": "100000000"
},
{
"key": "app_state.ccvconsumer.params.soft_opt_out_threshold",
"value": "0.05"
},
{
"key": "app_state.ccvconsumer.params.reward_denoms",
"value": ["untrn"]
},
{
"key": "app_state.ccvconsumer.params.provider_reward_denoms",
"value": ["uatom"]
},
{
"key": "consensus_params.block.max_gas",
"value": "1000000000"
},
{
"key": "app_state.globalfee.params.minimum_gas_prices",
"value": [
{
"denom": "untrn",
"amount": "0"
}
]
},
{
"key": "app_state.feeburner.params.treasury_address",
"value": "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky"
},
{
"key": "app_state.tokenfactory.params.fee_collector_address",
"value": "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky"
},
{
"key": "app_state.interchainaccounts.host_genesis_state.params.allow_messages",
"value": [
"/cosmos.bank.v1beta1.MsgSend",
"/cosmos.bank.v1beta1.MsgMultiSend",
"/cosmos.staking.v1beta1.MsgDelegate",
"/cosmos.staking.v1beta1.MsgUndelegate",
"/cosmos.staking.v1beta1.MsgBeginRedelegate",
"/cosmos.staking.v1beta1.MsgRedeemTokensforShares",
"/cosmos.staking.v1beta1.MsgTokenizeShares",
"/cosmos.distribution.v1beta1.MsgWithdrawDelegatorReward",
"/cosmos.distribution.v1beta1.MsgSetWithdrawAddress",
"/ibc.applications.transfer.v1.MsgTransfer",
"/ibc.lightclients.localhost.v2.ClientState",
"/ibc.core.client.v1.MsgCreateClient",
"/ibc.core.client.v1.Query/ClientState",
"/ibc.core.client.v1.Query/ConsensusState",
"/ibc.core.connection.v1.Query/Connection"
]
}
],
"accounts": [
{
"name": "acc0",
"address": "neutron1hj5fveer5cjtn4wd6wstzugjfdxzl0xpznmsky",
"amount": "100000000000000000%DENOM%",
"mnemonic": "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
}
]
}
},
{
"name": "osmosis",
"chain_id": "localosmosis-1",
"denom": "uosmo",
"binary": "osmosisd",
"bech32_prefix": "osmo",
"docker_image": {
"version": "v25.0.4",
"repository": "ghcr.io/strangelove-ventures/heighliner/osmosis"
},
"gas_prices": "0.0025%DENOM%",
"chain_type": "cosmos",
"coin_type": 118,
"trusting_period": "336h",
"gas_adjustment": 2,
"number_vals": 1,
"number_node": 0,
"ibc_paths": ["neutron-osmosis"],
"debugging": true,
"block_time": "500ms",
"host_port_override": {
"26657": "26659",
"1317": "1319",
"9090": "9092"
},
"genesis": {
"modify": [
{
"key": "app_state.gov.params.voting_period",
"value": "3s"
},
{
"key": "app_state.gov.params.max_deposit_period",
"value": "15s"
},
{
"key": "app_state.gov.params.min_deposit.0.denom",
"value": "uosmo"
}
],
"accounts": [
{
"name": "acc0",
"address": "osmo1hj5fveer5cjtn4wd6wstzugjfdxzl0xpwhpz63",
"amount": "10000000000%DENOM%",
"mnemonic": "decorate bright ozone fork gallery riot bus exhaust worth way bone indoor calm squirrel merry zero scheme cotton until shop any excess stage laundry"
}
]
}
}
]
}
Loading
Loading