Skip to content

Commit

Permalink
Merge branch 'master' into bh/778-use-polkadot-node
Browse files Browse the repository at this point in the history
  • Loading branch information
haerdib committed Sep 17, 2024
2 parents 88f9fa2 + 69b4d76 commit 2c15b08
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
12 changes: 7 additions & 5 deletions compose-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ macro_rules! compose_call {
/// * 'pallet_metadata' - This crate's parsed pallet metadata as field of the API.
/// * 'call_name' - Call name as &str
/// * 'args' - Optional sequence of arguments of the call. They are not checked against the metadata.
/// As of now the user needs to check himself that the correct arguments are supplied.
/// As of now the user needs to check himself that the correct arguments are supplied.
#[macro_export]
macro_rules! compose_call_for_pallet_metadata {
($pallet_metadata: expr, $call_name: expr $(, $args: expr) *) => {
Expand Down Expand Up @@ -145,8 +145,9 @@ macro_rules! compose_extrinsic_with_nonce {
};
}

/// Generates an UncheckedExtrinsic for the given pallet and call, if they are found within the metadata.
/// Otherwise None is returned.
/// Generates an UncheckedExtrinsic for the given pallet and call from the metadata.
///
/// Returns None if call is not found within metadata.
/// Fetches the nonce from the given `api` instance. If this fails, zero is taken as default nonce.
/// See also compose_extrinsic_with_nonce
#[macro_export]
Expand All @@ -164,8 +165,9 @@ macro_rules! compose_extrinsic {
};
}

/// Generates an UncheckedExtrinsic for the given pallet and call, if they are found within the metadata.
/// Otherwise None is returned.
/// Generates an UncheckedExtrinsic for the given pallet and call from the metadata.
///
/// Returns None if call is not found within metadata.
/// Fetches the nonce from the given `api` instance. If this fails, zero is taken as default nonce.
/// See also compose_extrinsic_with_nonce
#[macro_export]
Expand Down
1 change: 0 additions & 1 deletion node-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
//! Contains stuff to instantiate communication with a substrate node.

#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(error_in_core))]

extern crate alloc;

Expand Down
2 changes: 2 additions & 0 deletions primitives/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ pub trait Config {
+ DeserializeOwned;
}

/// Helper struct for fast Config creation with different Extrinsic Params than the original Config.
///
/// Take a type implementing [`Config`] (eg [`AssetRuntimeConfig`]), and some type which describes the
/// additional and extra parameters to pass to an extrinsic (see [`ExtrinsicParams`]),
/// and returns a type implementing [`Config`] with those new [`ExtrinsicParams`].
Expand Down
5 changes: 2 additions & 3 deletions primitives/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ pub struct InclusionFee<Balance> {
/// - `targeted_fee_adjustment`: This is a multiplier that can tune the final fee based on the
/// congestion of the network.
/// - `weight_fee`: This amount is computed based on the weight of the transaction. Weight
/// accounts for the execution time of a transaction.
///
/// adjusted_weight_fee = targeted_fee_adjustment * weight_fee
/// accounts for the execution time of a transaction.
/// - `adjusted_weight_fee`` = targeted_fee_adjustment * weight_fee
pub adjusted_weight_fee: Balance,
}

Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2024-04-25"
channel = "nightly-2024-09-01"
targets = ["wasm32-unknown-unknown", "wasm32-wasip1"]
profile = "default" # include rustfmt, clippy
4 changes: 0 additions & 4 deletions src/api/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ use ac_node_api::{
};
use alloc::{boxed::Box, vec::Vec};
use codec::{Decode, Encode};

#[cfg(not(feature = "std"))]
use core::error::Error as ErrorT;
#[cfg(feature = "std")]
use std::error::Error as ErrorT;

pub type Result<T> = core::result::Result<T, Error>;

Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
#![cfg_attr(not(feature = "std"), no_std)]
#![cfg_attr(not(feature = "std"), feature(error_in_core))]

extern crate alloc;

Expand Down
3 changes: 0 additions & 3 deletions src/rpc/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
*/

use alloc::{boxed::Box, string::String};
#[cfg(not(feature = "std"))]
use core::error::Error as ErrorT;
#[cfg(feature = "std")]
use std::error::Error as ErrorT;

pub type Result<T> = core::result::Result<T, Error>;

Expand Down
6 changes: 3 additions & 3 deletions test-no-std/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ unsafe impl GlobalAlloc for SimpleAllocator {
let align_mask_to_round_down = !(align - 1);

if align > MAX_SUPPORTED_ALIGN {
return null_mut()
return null_mut();
}

let mut allocated = 0;
if self
.remaining
.fetch_update(SeqCst, SeqCst, |mut remaining| {
if size > remaining {
return None
return None;
}
remaining -= size;
remaining &= align_mask_to_round_down;
Expand All @@ -112,7 +112,7 @@ unsafe impl GlobalAlloc for SimpleAllocator {
})
.is_err()
{
return null_mut()
return null_mut();
};
(self.arena.get() as *mut u8).add(allocated)
}
Expand Down

0 comments on commit 2c15b08

Please sign in to comment.