Skip to content

Commit

Permalink
Update subxt types (#418)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmarkushin authored Sep 21, 2023
1 parent c761976 commit 1b1a2ff
Show file tree
Hide file tree
Showing 7 changed files with 444 additions and 374 deletions.
3 changes: 2 additions & 1 deletion hyperspace/core/src/substrate/composable.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use self::parachain_subxt::api::{
ibc::calls::{Deliver, Transfer},
runtime_types::{
common::ibc::RawMemo,
frame_system::{extensions::check_nonce::CheckNonce, EventRecord},
pallet_ibc::{events::IbcEvent as MetadataIbcEvent, TransferParams as RawTransferParams},
},
Expand Down Expand Up @@ -165,7 +166,7 @@ define_runtime_transactions!(
TransferParamsWrapper,
DummySendPingParamsWrapper,
parachain_subxt::api::runtime_types::pallet_ibc::Any,
String,
RawMemo,
|x| parachain_subxt::api::tx().ibc().deliver(x),
|x, y, z, w| parachain_subxt::api::tx().ibc().transfer(x, CurrencyId(y), z, w),
|x| parachain_subxt::api::tx().sudo().sudo(x),
Expand Down
17 changes: 7 additions & 10 deletions hyperspace/core/src/substrate/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ use self::parachain_subxt::api::{
sudo::calls::Sudo,
};
use crate::{
define_any_wrapper, define_beefy_authority_set, define_event_record, define_events,
define_head_data, define_ibc_event_wrapper, define_id, define_para_lifecycle,
define_runtime_call, define_runtime_event, define_runtime_storage, define_runtime_transactions,
define_send_ping_params, define_transfer_params,
substrate::default::relaychain::api::runtime_types::sp_beefy::mmr::BeefyAuthoritySet,
define_any_wrapper, define_event_record, define_events, define_head_data,
define_ibc_event_wrapper, define_id, define_para_lifecycle, define_runtime_call,
define_runtime_event, define_runtime_storage, define_runtime_transactions,
define_send_ping_params, define_transfer_params, substrate::DummyBeefyAuthoritySet,
};
use async_trait::async_trait;
use codec::{Compact, Decode, Encode};
use ibc_proto::google::protobuf::Any;
use light_client_common::config::{
BeefyAuthoritySetT, EventRecordT, IbcEventsT, LocalAddress, ParaLifecycleT, RuntimeCall,
RuntimeStorage, RuntimeTransactions,
EventRecordT, IbcEventsT, LocalAddress, ParaLifecycleT, RuntimeCall, RuntimeStorage,
RuntimeTransactions,
};
use pallet_ibc::{events::IbcEvent as RawIbcEvent, MultiAddress, Timeout, TransferParams};
use pallet_ibc_ping::SendPingParams;
Expand Down Expand Up @@ -76,14 +75,12 @@ define_head_data!(

define_para_lifecycle!(DefaultParaLifecycle, ParaLifecycle);

define_beefy_authority_set!(DefaultBeefyAuthoritySet, BeefyAuthoritySet<T>);

define_runtime_storage!(
DefaultRuntimeStorage,
DefaultHeadData,
DefaultId,
DefaultParaLifecycle,
DefaultBeefyAuthoritySet<H256>,
DummyBeefyAuthoritySet,
parachain_subxt::api::storage().timestamp().now(),
|x| relaychain::api::storage().paras().heads(x),
|x| relaychain::api::storage().paras().para_lifecycles(x),
Expand Down
3 changes: 2 additions & 1 deletion hyperspace/core/src/substrate/picasso_kusama.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use self::parachain_subxt::api::{
ibc::calls::{Deliver, Transfer},
runtime_types::{
common::ibc::RawMemo,
frame_system::{extensions::check_nonce::CheckNonce, EventRecord},
pallet_ibc::{events::IbcEvent as MetadataIbcEvent, TransferParams as RawTransferParams},
},
Expand Down Expand Up @@ -125,7 +126,7 @@ define_runtime_transactions!(
TransferParamsWrapper,
DummySendPingParamsWrapper,
parachain_subxt::api::runtime_types::pallet_ibc::Any,
String,
RawMemo,
|x| parachain_subxt::api::tx().ibc().deliver(x),
|x, y, z, w| parachain_subxt::api::tx().ibc().transfer(x, CurrencyId(y), z, w),
|x| parachain_subxt::api::tx().sudo().sudo(x),
Expand Down
3 changes: 2 additions & 1 deletion hyperspace/core/src/substrate/picasso_rococo.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use self::parachain_subxt::api::{
ibc::calls::{Deliver, Transfer},
runtime_types::{
common::ibc::RawMemo,
frame_system::{extensions::check_nonce::CheckNonce, EventRecord},
pallet_ibc::{events::IbcEvent as MetadataIbcEvent, TransferParams as RawTransferParams},
},
Expand Down Expand Up @@ -120,7 +121,7 @@ define_runtime_transactions!(
TransferParamsWrapper,
DummySendPingParamsWrapper,
parachain_subxt::api::runtime_types::pallet_ibc::Any,
String,
RawMemo,
|x| parachain_subxt::api::tx().ibc().deliver(x),
|x, y, z, w| parachain_subxt::api::tx().ibc().transfer(x, CurrencyId(y), z, w),
|x| parachain_subxt::api::tx().sudo().sudo(x),
Expand Down
Loading

0 comments on commit 1b1a2ff

Please sign in to comment.