Skip to content

Commit

Permalink
Updated Core and Polkadot SDK version (#628)
Browse files Browse the repository at this point in the history
* Updated Core and Polkadot SDK version

* Updated avail-rust metadata

* Updated Cargo.lock files

* dep update
  • Loading branch information
markopoloparadox authored Aug 7, 2024
1 parent fc2b72b commit fe7e862
Show file tree
Hide file tree
Showing 14 changed files with 1,435 additions and 750 deletions.
553 changes: 351 additions & 202 deletions Cargo.lock

Large diffs are not rendered by default.

240 changes: 120 additions & 120 deletions Cargo.toml

Large diffs are not rendered by default.

232 changes: 143 additions & 89 deletions avail-rust/Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions avail-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ codec = { package = "parity-scale-codec", version = "3", default-features = fals
"bit-vec",
] }
scale-info = { version = "2.5.0", features = ["bit-vec"] }
avail-core = { git = "https://github.com/availproject/avail-core", tag = "node-v2230-rc2", features = ["serde", "runtime"] }
avail-core = { git = "https://github.com/availproject/avail-core", tag = "core-node-1", features = ["serde", "runtime"] }
hex = { version = "0.4" }
base58 = { version = "0.2.0" }
tokio = { version = "1.21.2" }

[patch.crates-io]
sp-core = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-7" }
sp-io = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-7" }
sp-runtime = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-7" }
sp-std = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-7" }
sp-core = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-8" }
sp-io = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-8" }
sp-runtime = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-8" }
sp-std = { git = "https://github.com/availproject/polkadot-sdk.git", tag = "polkadot-1.7.1-patch-8" }
162 changes: 162 additions & 0 deletions avail-rust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
How to build the API
1. Run Node
2. Run `./build_api.sh` script
3. Manually do the following change:

```diff
#[codec(index = 42)]
- TreasuryCommittee(runtime_types::pallet_collective::pallet::Call),
+ TreasuryCommittee(runtime_types::pallet_collective::pallet::Call2),
```

and

Inisde `pub mod api { pub mod runtime_types { pub mod pallet_collective { pub mod pallet }}}` duplicate the whole `pub enum Call` enum and call it `pub enum Call2`.

Should look like this
```diff
#[derive(
:: subxt :: ext :: subxt_core :: ext :: codec :: Decode,
:: subxt :: ext :: subxt_core :: ext :: codec :: Encode,
:: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType,
:: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType,
Clone,
Debug,
Eq,
PartialEq,
)]
# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)]
#[decode_as_type(
crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode"
)]
#[encode_as_type(
crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode"
)]
#[doc = "Contains a variant per dispatchable extrinsic that this pallet has."]
pub enum Call {
#[codec(index = 0)]
#[doc = "See [`Pallet::set_members`]."]
set_members {
new_members: ::subxt::ext::subxt_core::alloc::vec::Vec<
::subxt::ext::subxt_core::utils::AccountId32,
>,
prime: ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>,
old_count: ::core::primitive::u32,
},
#[codec(index = 1)]
#[doc = "See [`Pallet::execute`]."]
execute {
proposal: ::subxt::ext::subxt_core::alloc::boxed::Box<
runtime_types::da_runtime::RuntimeCall,
>,
#[codec(compact)]
length_bound: ::core::primitive::u32,
},
#[codec(index = 2)]
#[doc = "See [`Pallet::propose`]."]
propose {
#[codec(compact)]
threshold: ::core::primitive::u32,
proposal: ::subxt::ext::subxt_core::alloc::boxed::Box<
runtime_types::da_runtime::RuntimeCall,
>,
#[codec(compact)]
length_bound: ::core::primitive::u32,
},
#[codec(index = 3)]
#[doc = "See [`Pallet::vote`]."]
vote {
proposal: ::subxt::ext::subxt_core::utils::H256,
#[codec(compact)]
index: ::core::primitive::u32,
approve: ::core::primitive::bool,
},
#[codec(index = 5)]
#[doc = "See [`Pallet::disapprove_proposal`]."]
disapprove_proposal {
proposal_hash: ::subxt::ext::subxt_core::utils::H256,
},
#[codec(index = 6)]
#[doc = "See [`Pallet::close`]."]
close {
proposal_hash: ::subxt::ext::subxt_core::utils::H256,
#[codec(compact)]
index: ::core::primitive::u32,
proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight,
#[codec(compact)]
length_bound: ::core::primitive::u32,
},
}
+ #[derive(
+ :: subxt :: ext :: subxt_core :: ext :: codec :: Decode,
+ :: subxt :: ext :: subxt_core :: ext :: codec :: Encode,
+ :: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType,
+ :: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType,
+ Clone,
+ Debug,
+ Eq,
+ PartialEq,
+ )]
+ # [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)]
+ #[decode_as_type(
+ crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode"
+ )]
+ #[encode_as_type(
+ crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode"
+ )]
+ #[doc = "Contains a variant per dispatchable extrinsic that this pallet has."]
+ pub enum Call2 {
+ #[codec(index = 0)]
+ #[doc = "See [`Pallet::set_members`]."]
+ set_members {
+ new_members: ::subxt::ext::subxt_core::alloc::vec::Vec<
+ ::subxt::ext::subxt_core::utils::AccountId32,
+ >,
+ prime: ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>,
+ old_count: ::core::primitive::u32,
+ },
+ #[codec(index = 1)]
+ #[doc = "See [`Pallet::execute`]."]
+ execute {
+ proposal: ::subxt::ext::subxt_core::alloc::boxed::Box<
+ runtime_types::da_runtime::RuntimeCall,
+ >,
+ #[codec(compact)]
+ length_bound: ::core::primitive::u32,
+ },
+ #[codec(index = 2)]
+ #[doc = "See [`Pallet::propose`]."]
+ propose {
+ #[codec(compact)]
+ threshold: ::core::primitive::u32,
+ proposal: ::subxt::ext::subxt_core::alloc::boxed::Box<
+ runtime_types::da_runtime::RuntimeCall,
+ >,
+ #[codec(compact)]
+ length_bound: ::core::primitive::u32,
+ },
+ #[codec(index = 3)]
+ #[doc = "See [`Pallet::vote`]."]
+ vote {
+ proposal: ::subxt::ext::subxt_core::utils::H256,
+ #[codec(compact)]
+ index: ::core::primitive::u32,
+ approve: ::core::primitive::bool,
+ },
+ #[codec(index = 5)]
+ #[doc = "See [`Pallet::disapprove_proposal`]."]
+ disapprove_proposal {
+ proposal_hash: ::subxt::ext::subxt_core::utils::H256,
+ },
+ #[codec(index = 6)]
+ #[doc = "See [`Pallet::close`]."]
+ close {
+ proposal_hash: ::subxt::ext::subxt_core::utils::H256,
+ #[codec(compact)]
+ index: ::core::primitive::u32,
+ proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight,
+ #[codec(compact)]
+ length_bound: ::core::primitive::u32,
+ },
+ }
```
74 changes: 73 additions & 1 deletion avail-rust/src/api_dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27850,7 +27850,7 @@ pub mod api {
#[codec(index = 41)]
TxPause(runtime_types::pallet_tx_pause::pallet::Call),
#[codec(index = 42)]
TreasuryCommittee(runtime_types::pallet_collective::pallet::Call),
TreasuryCommittee(runtime_types::pallet_collective::pallet::Call2),
}
#[derive(
:: subxt :: ext :: subxt_core :: ext :: codec :: Decode,
Expand Down Expand Up @@ -29732,6 +29732,78 @@ pub mod api {
#[encode_as_type(
crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode"
)]
#[doc = "Contains a variant per dispatchable extrinsic that this pallet has."]
pub enum Call2 {
#[codec(index = 0)]
#[doc = "See [`Pallet::set_members`]."]
set_members {
new_members: ::subxt::ext::subxt_core::alloc::vec::Vec<
::subxt::ext::subxt_core::utils::AccountId32,
>,
prime: ::core::option::Option<::subxt::ext::subxt_core::utils::AccountId32>,
old_count: ::core::primitive::u32,
},
#[codec(index = 1)]
#[doc = "See [`Pallet::execute`]."]
execute {
proposal: ::subxt::ext::subxt_core::alloc::boxed::Box<
runtime_types::da_runtime::RuntimeCall,
>,
#[codec(compact)]
length_bound: ::core::primitive::u32,
},
#[codec(index = 2)]
#[doc = "See [`Pallet::propose`]."]
propose {
#[codec(compact)]
threshold: ::core::primitive::u32,
proposal: ::subxt::ext::subxt_core::alloc::boxed::Box<
runtime_types::da_runtime::RuntimeCall,
>,
#[codec(compact)]
length_bound: ::core::primitive::u32,
},
#[codec(index = 3)]
#[doc = "See [`Pallet::vote`]."]
vote {
proposal: ::subxt::ext::subxt_core::utils::H256,
#[codec(compact)]
index: ::core::primitive::u32,
approve: ::core::primitive::bool,
},
#[codec(index = 5)]
#[doc = "See [`Pallet::disapprove_proposal`]."]
disapprove_proposal {
proposal_hash: ::subxt::ext::subxt_core::utils::H256,
},
#[codec(index = 6)]
#[doc = "See [`Pallet::close`]."]
close {
proposal_hash: ::subxt::ext::subxt_core::utils::H256,
#[codec(compact)]
index: ::core::primitive::u32,
proposal_weight_bound: runtime_types::sp_weights::weight_v2::Weight,
#[codec(compact)]
length_bound: ::core::primitive::u32,
},
}
#[derive(
:: subxt :: ext :: subxt_core :: ext :: codec :: Decode,
:: subxt :: ext :: subxt_core :: ext :: codec :: Encode,
:: subxt :: ext :: subxt_core :: ext :: scale_decode :: DecodeAsType,
:: subxt :: ext :: subxt_core :: ext :: scale_encode :: EncodeAsType,
Clone,
Debug,
Eq,
PartialEq,
)]
# [codec (crate = :: subxt :: ext :: subxt_core :: ext :: codec)]
#[decode_as_type(
crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_decode"
)]
#[encode_as_type(
crate_path = ":: subxt :: ext :: subxt_core :: ext :: scale_encode"
)]
#[doc = "The `Error` enum of this pallet."]
pub enum Error {
#[codec(index = 0)]
Expand Down
Loading

0 comments on commit fe7e862

Please sign in to comment.