Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Merge branch 'main' into A0-1614-hide-subxt-types
  • Loading branch information
krzysztofziobro committed Jan 20, 2023
commit 30486363768320c82faabcf64959f8cf38a0b224
4 changes: 2 additions & 2 deletions aleph-client/src/connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ use subxt::{
};

use crate::{
api, sp_weights::weight_v2::Weight, AccountId, BlockHash, Call, KeyPair, ParamsBuilder,
RpcCallParams, SubxtClient, TxStatus,
api, sp_weights::weight_v2::Weight, AccountId, AlephConfig, BlockHash, Call, KeyPair,
ParamsBuilder, RpcCallParams, SubxtClient, TxHash, TxStatus,
};

/// Capable of communicating with a live Aleph chain.
Expand Down
2 changes: 1 addition & 1 deletion aleph-client/src/contract/convertible_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ mod tests {
let cast: bool = ConvertibleValue(Bool(true))
.try_into()
.expect("Should cast successfully");
assert_eq!(true, cast);
assert!(cast);
}

#[test]
Expand Down
13 changes: 7 additions & 6 deletions aleph-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ pub type AlephKeyPair = ed25519::Pair;
pub type RawKeyPair = sr25519::Pair;
/// An alias for an account id type.
pub type AccountId = subxt::ext::sp_core::crypto::AccountId32;
/// An alias for a client type.
pub type SubxtClient = OnlineClient<AlephConfig>;
/// An alias for a hash type.
pub type BlockHash = H256;
/// An alias for a hash type.
pub type CodeHash = H256;

type PairSigner = subxt::tx::PairSigner<AlephConfig, RawKeyPair>;
/// An alias for a block hash type.
pub type BlockHash = H256;
/// An alias for a transaction hash type.
pub type TxHash = H256;
/// An alias for an RPC client type.
pub type SubxtClient = OnlineClient<AlephConfig>;

pub use connections::{
AsConnection, AsSigned, Connection, ConnectionApi, RootConnection, SignedConnection,
Expand All @@ -65,6 +65,7 @@ pub use connections::{
/// An alias for a configuration of live chain, e.g. block index type, hash type.
type AlephConfig = PolkadotConfig;
type ParamsBuilder = subxt::tx::PolkadotExtrinsicParamsBuilder<SubstrateConfig>;
type PairSigner = subxt::tx::PairSigner<AlephConfig, RawKeyPair>;

/// Wrapped around subxt PairSigner
pub struct KeyPair {
Expand Down
1 change: 0 additions & 1 deletion aleph-client/src/pallets/balances.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use primitives::Balance;
use subxt::ext::sp_runtime::MultiAddress;

use crate::{
Expand Down
13 changes: 4 additions & 9 deletions aleph-client/src/pallets/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use pallet_contracts_primitives::ContractExecResult;
use subxt::{ext::sp_core::Bytes, rpc_params};

use crate::{
api, pallet_contracts::wasm::OwnerInfo, sp_weights::weight_v2::Weight, AccountId, BlockHash,
CodeHash, ConnectionApi, RpcCallParams, SignedConnectionApi, TxStatus,
api, pallet_contracts::wasm::OwnerInfo, sp_weights::weight_v2::Weight, AccountId, Balance,
BlockHash, CodeHash, ConnectionApi, RpcCallParams, SignedConnectionApi, TxInfo, TxStatus,
};

/// Arguments to [`ContractRpc::call_and_get`].
Expand Down Expand Up @@ -83,8 +83,7 @@ pub trait ContractsUserApi {
) -> anyhow::Result<TxInfo>;

/// API for [`remove_code`](https://paritytech.github.io/substrate/master/pallet_contracts/pallet/struct.Pallet.html#method.remove_code) call.
async fn remove_code(&self, code_hash: CodeHash, status: TxStatus)
-> anyhow::Result<BlockHash>;
async fn remove_code(&self, code_hash: BlockHash, status: TxStatus) -> anyhow::Result<TxInfo>;
}

/// RPC for runtime ContractsApi
Expand Down Expand Up @@ -183,11 +182,7 @@ impl<S: SignedConnectionApi> ContractsUserApi for S {
self.send_tx(tx, status).await
}

async fn remove_code(
&self,
code_hash: CodeHash,
status: TxStatus,
) -> anyhow::Result<BlockHash> {
async fn remove_code(&self, code_hash: BlockHash, status: TxStatus) -> anyhow::Result<TxInfo> {
let tx = api::tx().contracts().remove_code(code_hash);

self.send_tx(tx, status).await
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.