Skip to content

Commit

Permalink
Add Union Testnet (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
adairrr authored Aug 8, 2024
1 parent 6ec149d commit 4b28561
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 2 deletions.
20 changes: 20 additions & 0 deletions cw-orch-daemon/src/queriers/ibc.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::{cosmos_modules, error::DaemonError, Daemon};
use cosmos_modules::ibc_channel;
use cosmrs::proto::cosmos::base::query::v1beta1::PageRequest;
use cosmrs::proto::ibc::{
applications::transfer::v1::{DenomTrace, QueryDenomHashResponse, QueryDenomTraceResponse},
core::{
Expand Down Expand Up @@ -285,6 +286,25 @@ impl Ibc {
)))
}

/// List all the channels
pub async fn _channels(
&self,
pagination: Option<PageRequest>,
) -> Result<Vec<ibc_channel::IdentifiedChannel>, DaemonError> {
use cosmos_modules::ibc_channel::QueryChannelsResponse;

let ibc_channels: QueryChannelsResponse = cosmos_query!(
self,
ibc_channel,
channels,
QueryChannelsRequest {
pagination: pagination
}
);

Ok(ibc_channels.channels)
}

/// Get all the channels for a specific connection
pub async fn _connection_channels(
&self,
Expand Down
6 changes: 5 additions & 1 deletion docs/src/chains/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ cw-orchestrator currently explicitly supports the chains in this section:
- [Injective](./injective.md)
- [Juno](./juno.md)
- [Kujira](./kujira.md)
- [Landslide](./landslide.md)
- [Migaloo](./migaloo.md)
- [Neutron](./neutron.md)
- [Nibiru](./nibiru.md)
- [Osmosis](./osmosis.md)
- [Rollkit](./rollkit.md)
- [Sei](./sei.md)
- [Terra](./terra.md)
- [Rollkit](./rollkit.md)
- [Union](./union.md)
- [Xion](./xion.md)

## Support a new Cosmos Chain
Expand Down
20 changes: 20 additions & 0 deletions docs/src/chains/union.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Union

Union is the first infrastructure layer that unifies thousands of networks, unlocking horizontal scalability for any protocol.


[Visit Union's Website](https://union.build)

```rust,ignore
{{#include ../../../packages/cw-orch-networks/src/networks/union.rs:union}}
```

## Usage

See how to setup your main function in the [main function](../contracts/scripting.md#main-function) section. Update the network passed into the `Daemon` builder to be `networks::UNION_TESTNET`.

## References

- [Union Documentation](https://union.build/docs/)
- [Union Discord](https://discord.union.build)
- [Union Testnet Faucet](https://app.union.build/faucet)
4 changes: 4 additions & 0 deletions packages/cw-orch-networks/src/networks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ pub mod osmosis;
pub mod rollkit;
pub mod sei;
pub mod terra;
pub mod union;
pub mod xion;

use crate::networks::union::UNION_TESTNET_8;
pub use archway::{ARCHWAY_1, CONSTANTINE_3};
pub use cw_orch_core::environment::{ChainInfo, ChainKind, NetworkInfo};
pub use doravota::{VOTA_ASH, VOTA_TESTNET};
Expand All @@ -32,6 +34,7 @@ pub use rollkit::{LOCAL_ROLLKIT, ROLLKIT_TESTNET};
pub use sei::{ATLANTIC_2, LOCAL_SEI, PACIFIC_1, SEI_DEVNET_3};
pub use terra::{LOCAL_TERRA, PHOENIX_1, PISCO_1};
pub use xion::XION_TESTNET_1;

/// A helper function to retrieve a [`ChainInfo`] struct for a given chain-id.
///
/// ## Example
Expand Down Expand Up @@ -78,4 +81,5 @@ pub const SUPPORTED_NETWORKS: &[ChainInfo] = &[
XION_TESTNET_1,
ROLLKIT_TESTNET,
LOCAL_LANDSLIDE,
UNION_TESTNET_8,
];
23 changes: 23 additions & 0 deletions packages/cw-orch-networks/src/networks/union.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use cw_orch_core::environment::{ChainInfo, ChainKind, NetworkInfo};

// ANCHOR: union
pub const UNION_NETWORK: NetworkInfo = NetworkInfo {
chain_name: "union",
pub_address_prefix: "union",
coin_type: 118,
};

pub const UNION_TESTNET: ChainInfo = UNION_TESTNET_8;

pub const UNION_TESTNET_8: ChainInfo = ChainInfo {
kind: ChainKind::Testnet,
chain_id: "union-testnet-8",
gas_denom: "muno",
gas_price: 0.000025,
grpc_urls: &["https://grpc.testnet-8.union.build:443"],
network_info: UNION_NETWORK,
lcd_url: None,
fcd_url: None,
};

// ANCHOR_END: union
1 change: 1 addition & 0 deletions packages/interchain/interchain-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub enum IbcPacketOutcome<T> {
}

/// Structure to hold simple information about a sent packet
#[derive(Debug, Clone)]
pub struct IbcPacketInfo {
/// Port on which is packet was sent
pub src_port: PortId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ fn get_events(events: &[TxResultBlockEvent], attr_name: &str) -> Vec<String> {
.collect()
}

async fn find_ibc_packets_sent_in_tx(
pub async fn find_ibc_packets_sent_in_tx(
chain: NetworkId,
grpc_channel: Channel,
tx: CosmTxResponse,
Expand Down

0 comments on commit 4b28561

Please sign in to comment.