mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 13:38:11 +00:00
runtime API: Substitute UncheckedExtrinsic with custom encoding (#1076)
* codegen: Add uncheckedExtrinsic substitute Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Add uncheckedExtrinsic replacement Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * testing: Test uncheckedExtrinsic encoding Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * testing: Apply clippy Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Implement encode_to instead of encode for uncheckedExtrinsic Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt: Remove encode_as_fields from uncheckedExtrinsic Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Extend the UncheckedExtrinsic interface Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Use Static<Encoded> for uncheckedExtrinsic Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Remove extra impl on the uncheckedExtrinsic Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Add back the EncodeAsType Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Simplify the decode_as_type Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Use encode_as_type Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: impl Decode for UncheckedExtrinsic Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update subxt/src/utils/unchecked_extrinsic.rs Co-authored-by: James Wilson <james@jsdw.me> * utils: Apply cargo fmt Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils: Check encoding / decoding of uncheckedExtrinsic Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * utils/tests: Use an already encoded tx bytes to start with Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
@@ -9,6 +9,7 @@ pub mod bits;
|
||||
mod multi_address;
|
||||
mod multi_signature;
|
||||
mod static_type;
|
||||
mod unchecked_extrinsic;
|
||||
mod wrapper_opaque;
|
||||
|
||||
use codec::{Compact, Decode, Encode};
|
||||
@@ -18,6 +19,7 @@ pub use account_id::AccountId32;
|
||||
pub use multi_address::MultiAddress;
|
||||
pub use multi_signature::MultiSignature;
|
||||
pub use static_type::Static;
|
||||
pub use unchecked_extrinsic::UncheckedExtrinsic;
|
||||
pub use wrapper_opaque::WrapperKeepOpaque;
|
||||
|
||||
// Used in codegen
|
||||
@@ -26,7 +28,7 @@ pub use primitive_types::{H160, H256, H512};
|
||||
|
||||
/// Wraps an already encoded byte vector, prevents being encoded as a raw byte vector as part of
|
||||
/// the transaction payload
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
#[derive(Clone, Debug, Eq, PartialEq, Decode)]
|
||||
pub struct Encoded(pub Vec<u8>);
|
||||
|
||||
impl codec::Encode for Encoded {
|
||||
|
||||
Reference in New Issue
Block a user