Skip to content

Commit 3162233

Browse files
authored
Update Metadata, Error and Events (#597)
* we're getting there.. * add missing file * finaling compiling! * fix test * remove unused stuff * clean up metadata * move impl metadata * fix build * clean up node-api Error * remove unused errors * update error and event headers * add linker comments * remove clone
1 parent 19c6397 commit 3162233

File tree

23 files changed

+935
-742
lines changed

23 files changed

+935
-742
lines changed

Cargo.lock

Lines changed: 95 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

compose-macros/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ mod rpc;
3737
macro_rules! compose_call {
3838
($node_metadata: expr, $pallet: expr, $call_name: expr $(, $args: expr) *) => {
3939
{
40-
let pallet = $node_metadata.pallet($pallet).unwrap().to_owned();
40+
let pallet = $node_metadata.pallet_by_name($pallet).unwrap().to_owned();
4141

42-
let call_index = pallet.call_indexes.get($call_name).unwrap();
42+
let call_index = pallet.call_variant_by_name($call_name).unwrap().index;
4343

44-
([pallet.index, *call_index as u8] $(, ($args)) *)
44+
([pallet.index(), call_index as u8] $(, ($args)) *)
4545
}
4646
};
4747
}
@@ -93,7 +93,8 @@ macro_rules! compose_extrinsic_with_nonce {
9393

9494
debug!("Composing generic extrinsic for module {:?} and call {:?}", $module, $call);
9595

96-
let call = $crate::compose_call!($api.metadata().clone(), $module, $call $(, ($args)) *);
96+
let metadata = $api.metadata();
97+
let call = $crate::compose_call!(metadata, $module, $call $(, ($args)) *);
9798
if let Some(signer) = $api.signer() {
9899
$crate::compose_extrinsic_offline!(
99100
signer,

node-api/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ serde_json = { version = "1.0.79", default-features = false, features = ["alloc"
2323

2424
# scale
2525
scale-bits = { default-features = false, features = ["scale-info", "serde"], git = "https://github.com/haerdib/scale-bits.git", branch = "bh/no-std" }
26-
scale-decode = { default-features = false, features = ["primitive-types"], git = "https://github.com/scs/scale-decode.git", branch = "no-std" }
27-
scale-encode = { default-features = false, features = ["bits", "primitive-types"], git = "https://github.com/scs/scale-encode.git", branch = "no-std" }
26+
scale-decode = { default-features = false, features = ["primitive-types", "derive"], git = "https://github.com/scs/scale-decode.git", branch = "no-std" }
27+
scale-encode = { default-features = false, features = ["bits", "primitive-types", "derive"], git = "https://github.com/scs/scale-encode.git", branch = "no-std" }
2828

2929
# substrate
3030
sp-core = { default-features = false, features = ["full_crypto", "serde"], git = "https://github.com/paritytech/substrate.git", branch = "master" }
@@ -35,6 +35,9 @@ sp-storage = { default-features = false, features = ["serde"], git = "https://gi
3535
sp-application-crypto = { default-features = false, git = "https://github.com/paritytech/substrate.git", features = ["full_crypto"], branch = "master" }
3636
sp-runtime-interface = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "master" }
3737

38+
# local
39+
ac-primitives = { path = "../primitives", default-features = false }
40+
3841
[dev-dependencies]
3942
test-case = "3.1.0"
4043

0 commit comments

Comments
 (0)