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

Update to 0.9.29 #754

Merged
merged 11 commits into from
Nov 24, 2022
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
640 changes: 354 additions & 286 deletions Cargo.lock

Large diffs are not rendered by default.

349 changes: 205 additions & 144 deletions aleph-client/Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions aleph-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aleph_client"
version = "2.0.0"
version = "2.1.0"
edition = "2021"
license = "Apache 2.0"

Expand All @@ -19,8 +19,8 @@ subxt = "0.24.0"
futures = "0.3.25"
serde = { version = "1.0", features = ["derive"] }

frame-support = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" }
sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28", features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" }
pallet-contracts-primitives = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.28" }
frame-support = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.29" }
sp-core = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.29", features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.29" }
pallet-contracts-primitives = { git = "https://github.com/Cardinal-Cryptography/substrate.git", branch = "aleph-v0.9.29" }
primitives = { path = "../primitives" }
495 changes: 326 additions & 169 deletions aleph-client/src/aleph_zero.rs

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions aleph-client/src/connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use subxt::{
SubstrateConfig,
};

use crate::{api, BlockHash, Call, Client, KeyPair, TxStatus};
use crate::{
api, frame_support::weights::weight_v2::Weight, BlockHash, Call, Client, KeyPair, TxStatus,
};

#[derive(Clone)]
pub struct Connection {
Expand All @@ -39,7 +41,9 @@ pub trait SudoCall {
impl SudoCall for RootConnection {
async fn sudo_unchecked(&self, call: Call, status: TxStatus) -> anyhow::Result<BlockHash> {
info!(target: "aleph-client", "sending call as sudo_unchecked {:?}", call);
let sudo = api::tx().sudo().sudo_unchecked_weight(call, 0);
let sudo = api::tx()
.sudo()
.sudo_unchecked_weight(call, Weight { ref_time: 0 });

self.as_signed().send_tx(sudo, status).await
}
Expand Down
9 changes: 7 additions & 2 deletions aleph-client/src/contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use ink_metadata::{InkProject, MetadataVersioned};
use serde_json::{from_reader, from_value};

use crate::{
frame_support::weights::weight_v2::Weight,
pallets::contract::{ContractCallArgs, ContractRpc, ContractsUserApi},
AccountId, Connection, SignedConnection, TxStatus,
};
Expand Down Expand Up @@ -109,7 +110,9 @@ impl ContractInstance {
origin: self.address.clone(),
dest: self.address.clone(),
value: 0,
gas_limit: Self::MAX_READ_GAS,
gas_limit: Weight {
ref_time: Self::MAX_READ_GAS,
},
input_data: payload,
storage_deposit_limit: None,
};
Expand All @@ -134,7 +137,9 @@ impl ContractInstance {
conn.call(
self.address.clone(),
Self::PAYABLE_VALUE as u128,
Self::MAX_GAS,
Weight {
ref_time: Self::MAX_GAS,
},
Self::STORAGE_FEE_LIMIT,
data,
TxStatus::InBlock,
Expand Down
18 changes: 9 additions & 9 deletions aleph-client/src/pallets/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ use subxt::{
};

use crate::{
api, pallet_contracts::wasm::OwnerInfo, AccountId, BlockHash, Connection, SignedConnection,
TxStatus,
api, frame_support::weights::weight_v2::Weight, pallet_contracts::wasm::OwnerInfo, AccountId,
BlockHash, Connection, SignedConnection, TxStatus,
};

#[derive(Encode)]
pub struct ContractCallArgs {
pub origin: AccountId,
pub dest: AccountId,
pub value: Balance,
pub gas_limit: u64,
pub gas_limit: Weight,
pub storage_deposit_limit: Option<Balance>,
pub input_data: Vec<u8>,
}
Expand All @@ -43,7 +43,7 @@ pub trait ContractsUserApi {
&self,
code_hash: BlockHash,
balance: Balance,
gas_limit: u64,
gas_limit: Weight,
storage_limit: Option<Compact<u128>>,
data: Vec<u8>,
salt: Vec<u8>,
Expand All @@ -54,7 +54,7 @@ pub trait ContractsUserApi {
&self,
code: Vec<u8>,
balance: Balance,
gas_limit: u64,
gas_limit: Weight,
storage_limit: Option<Compact<u128>>,
data: Vec<u8>,
salt: Vec<u8>,
Expand All @@ -64,7 +64,7 @@ pub trait ContractsUserApi {
&self,
destination: AccountId,
balance: Balance,
gas_limit: u64,
gas_limit: Weight,
storage_limit: Option<Compact<u128>>,
data: Vec<u8>,
status: TxStatus,
Expand Down Expand Up @@ -111,7 +111,7 @@ impl ContractsUserApi for SignedConnection {
&self,
code_hash: BlockHash,
balance: Balance,
gas_limit: u64,
gas_limit: Weight,
storage_limit: Option<Compact<u128>>,
data: Vec<u8>,
salt: Vec<u8>,
Expand All @@ -133,7 +133,7 @@ impl ContractsUserApi for SignedConnection {
&self,
code: Vec<u8>,
balance: Balance,
gas_limit: u64,
gas_limit: Weight,
storage_limit: Option<Compact<u128>>,
data: Vec<u8>,
salt: Vec<u8>,
Expand All @@ -155,7 +155,7 @@ impl ContractsUserApi for SignedConnection {
&self,
destination: AccountId,
balance: Balance,
gas_limit: u64,
gas_limit: Weight,
storage_limit: Option<Compact<u128>>,
data: Vec<u8>,
status: TxStatus,
Expand Down
9 changes: 6 additions & 3 deletions aleph-client/src/pallets/multisig.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use primitives::{Balance, BlockNumber};

use crate::{api, api::runtime_types, AccountId, BlockHash, SignedConnection, TxStatus};
use crate::{
api, api::runtime_types, frame_support::weights::weight_v2::Weight, AccountId, BlockHash,
SignedConnection, TxStatus,
};

pub type CallHash = [u8; 32];
pub type Call = Vec<u8>;
Expand All @@ -14,7 +17,7 @@ pub trait MultisigUserApi {
threshold: u16,
other_signatories: Vec<AccountId>,
timepoint: Option<Timepoint>,
max_weight: u64,
max_weight: Weight,
call_hash: CallHash,
status: TxStatus,
) -> anyhow::Result<BlockHash>;
Expand All @@ -35,7 +38,7 @@ impl MultisigUserApi for SignedConnection {
threshold: u16,
other_signatories: Vec<AccountId>,
timepoint: Option<Timepoint>,
max_weight: u64,
max_weight: Weight,
call_hash: CallHash,
status: TxStatus,
) -> anyhow::Result<BlockHash> {
Expand Down
7 changes: 7 additions & 0 deletions aleph-client/src/runtime_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::{
sp_consensus_aura::sr25519::app_sr25519::Public as AuraPublic,
sp_core::{ed25519::Public as EdPublic, sr25519::Public as SrPublic},
},
frame_support::weights::weight_v2::Weight,
pallet_staking::EraRewardPoints,
};

Expand Down Expand Up @@ -40,3 +41,9 @@ impl TryFrom<String> for SessionKeys {
Ok(SessionKeys::from(bytes))
}
}

impl Weight {
pub fn new(ref_time: u64) -> Self {
Self { ref_time }
}
}
Loading