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 IBC client methods on chain context #96

Merged
merged 14 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 4 additions & 13 deletions light-client/Cargo.lock

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

53 changes: 27 additions & 26 deletions relayer/Cargo.lock

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

39 changes: 31 additions & 8 deletions relayer/crates/starknet-chain-components/src/components/chain.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
use cgp::core::component::WithProvider;
use cgp::core::types::impls::UseDelegatedType;
use cgp::prelude::*;
pub use hermes_cosmos_chain_components::components::client::{
ChannelIdTypeComponent, ClientIdTypeComponent, ClientStateFieldsGetterComponent,
ConnectionIdTypeComponent, CreateClientPayloadBuilderComponent,
CreateClientPayloadOptionsTypeComponent, CreateClientPayloadTypeComponent,
OutgoingPacketFieldsReaderComponent, OutgoingPacketTypeComponent, PortIdTypeComponent,
SequenceTypeComponent, TimeTypeComponent, TimeoutTypeComponent,
UpdateClientPayloadBuilderComponent, UpdateClientPayloadTypeComponent,
ChannelIdTypeComponent, ClientIdTypeComponent, ClientStateFieldsComponent,
ClientStateQuerierComponent, ConnectionIdTypeComponent, ConsensusStateQuerierComponent,
CreateClientMessageBuilderComponent, CreateClientMessageOptionsTypeComponent,
CreateClientPayloadBuilderComponent, CreateClientPayloadOptionsTypeComponent,
CreateClientPayloadTypeComponent, OutgoingPacketFieldsReaderComponent,
OutgoingPacketTypeComponent, PortIdTypeComponent, SequenceTypeComponent, TimeTypeComponent,
TimeoutTypeComponent, UpdateClientPayloadBuilderComponent, UpdateClientPayloadTypeComponent,
};
use hermes_cosmos_chain_components::impls::packet::packet_fields::CosmosPacketFieldReader;
use hermes_cosmos_chain_components::impls::types::chain::ProvideCosmosChainTypes;
use hermes_cosmos_chain_components::impls::types::create_client_options::ProvideNoCreateClientMessageOptionsType;
pub use hermes_relayer_components::chain::traits::queries::chain_status::ChainStatusQuerierComponent;
pub use hermes_relayer_components::chain::traits::send_message::MessageSenderComponent;
pub use hermes_relayer_components::chain::traits::types::chain_id::ChainIdTypeComponent;
Expand All @@ -34,13 +38,18 @@ pub use hermes_test_components::chain::traits::types::address::AddressTypeCompon
pub use hermes_test_components::chain::traits::types::amount::AmountTypeComponent;
pub use hermes_test_components::chain::traits::types::denom::DenomTypeComponent;

use crate::components::types::StarknetChainTypes;
use crate::impls::contract::call::CallStarknetContract;
use crate::impls::contract::declare::DeclareSierraContract;
use crate::impls::contract::deploy::DeployStarknetContract;
use crate::impls::contract::invoke::InvokeStarknetContract;
use crate::impls::contract::message::BuildInvokeContractCall;
use crate::impls::messages::create_client::BuildCreateCometClientMessage;
use crate::impls::payload_builders::create_client::BuildStarknetCreateClientPayload;
use crate::impls::payload_builders::update_client::BuildStarknetUpdateClientPayload;
use crate::impls::queries::client_state::QueryCometClientState;
use crate::impls::queries::consensus_state::QueryCometConsensusState;
use crate::impls::queries::contract_address::GetContractAddressFromField;
use crate::impls::queries::status::QueryStarknetChainStatus;
use crate::impls::queries::token_balance::QueryErc20TokenBalance;
use crate::impls::send_message::SendCallMessages;
Expand Down Expand Up @@ -69,6 +78,7 @@ pub use crate::traits::contract::deploy::ContractDeployerComponent;
pub use crate::traits::contract::invoke::ContractInvokerComponent;
pub use crate::traits::contract::message::InvokeContractMessageBuilderComponent;
pub use crate::traits::messages::transfer::TransferTokenMessageBuilderComponent;
pub use crate::traits::queries::address::ContractAddressQuerierComponent;
pub use crate::traits::queries::token_balance::TokenBalanceQuerierComponent;
pub use crate::traits::transfer::TokenTransferComponent;
pub use crate::traits::types::blob::BlobTypeComponent;
Expand Down Expand Up @@ -115,7 +125,6 @@ define_components! {
]:
ProvideStarknetContractTypes,
[
ClientIdTypeComponent,
ConnectionIdTypeComponent,
ChannelIdTypeComponent,
PortIdTypeComponent,
Expand All @@ -125,10 +134,14 @@ define_components! {
TimeoutTypeComponent,
]:
ProvideCosmosChainTypes,
[
ClientIdTypeComponent,
]:
WithProvider<UseDelegatedType<StarknetChainTypes>>,
[
ClientStateTypeComponent,
ConsensusStateTypeComponent,
ClientStateFieldsGetterComponent,
ClientStateFieldsComponent,
]:
ProvideStarknetIbcClientTypes,
[
Expand Down Expand Up @@ -169,9 +182,19 @@ define_components! {
TransferErc20Token,
TokenBalanceQuerierComponent:
QueryErc20TokenBalance,
CreateClientMessageOptionsTypeComponent:
ProvideNoCreateClientMessageOptionsType,
CreateClientPayloadBuilderComponent:
BuildStarknetCreateClientPayload,
CreateClientMessageBuilderComponent:
BuildCreateCometClientMessage,
UpdateClientPayloadBuilderComponent:
BuildStarknetUpdateClientPayload,
ClientStateQuerierComponent:
QueryCometClientState,
ConsensusStateQuerierComponent:
QueryCometConsensusState,
ContractAddressQuerierComponent:
GetContractAddressFromField,
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod chain;
pub mod encoding;
pub mod starknet_to_cosmos;
pub mod types;
Loading
Loading