mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 02:51:08 +00:00
fix polkadot primitives (#908)
This commit is contained in:
committed by
Bastian Köcher
parent
b8e021c22c
commit
f6fd87f39e
@@ -28,11 +28,12 @@ use frame_support::{
|
|||||||
Blake2_128Concat, RuntimeDebug, StorageHasher, Twox128,
|
Blake2_128Concat, RuntimeDebug, StorageHasher, Twox128,
|
||||||
};
|
};
|
||||||
use frame_system::limits;
|
use frame_system::limits;
|
||||||
|
use parity_scale_codec::Compact;
|
||||||
use sp_core::Hasher as HasherT;
|
use sp_core::Hasher as HasherT;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
generic,
|
generic,
|
||||||
traits::{BlakeTwo256, IdentifyAccount, Verify},
|
traits::{BlakeTwo256, IdentifyAccount, Verify},
|
||||||
MultiSignature, OpaqueExtrinsic, Perbill,
|
MultiAddress, MultiSignature, OpaqueExtrinsic, Perbill,
|
||||||
};
|
};
|
||||||
use sp_std::prelude::Vec;
|
use sp_std::prelude::Vec;
|
||||||
|
|
||||||
@@ -192,10 +193,19 @@ pub type SignedBlock = generic::SignedBlock<Block>;
|
|||||||
pub type Balance = u128;
|
pub type Balance = u128;
|
||||||
|
|
||||||
/// Unchecked Extrinsic type.
|
/// Unchecked Extrinsic type.
|
||||||
pub type UncheckedExtrinsic<Call> = generic::UncheckedExtrinsic<AccountId, Call, Signature, SignedExtensions<Call>>;
|
pub type UncheckedExtrinsic<Call> =
|
||||||
|
generic::UncheckedExtrinsic<MultiAddress<AccountId, ()>, Call, Signature, SignedExtensions<Call>>;
|
||||||
|
|
||||||
/// A type of the data encoded as part of the transaction.
|
/// A type of the data encoded as part of the transaction.
|
||||||
pub type SignedExtra = ((), (), (), sp_runtime::generic::Era, Nonce, (), Balance);
|
pub type SignedExtra = (
|
||||||
|
(),
|
||||||
|
(),
|
||||||
|
(),
|
||||||
|
sp_runtime::generic::Era,
|
||||||
|
Compact<Nonce>,
|
||||||
|
(),
|
||||||
|
Compact<Balance>,
|
||||||
|
);
|
||||||
|
|
||||||
/// Parameters which are part of the payload used to produce transaction signature,
|
/// Parameters which are part of the payload used to produce transaction signature,
|
||||||
/// but don't end up in the transaction itself (i.e. inherent part of the runtime).
|
/// but don't end up in the transaction itself (i.e. inherent part of the runtime).
|
||||||
@@ -232,13 +242,13 @@ impl<Call> SignedExtensions<Call> {
|
|||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
encode_payload: (
|
encode_payload: (
|
||||||
(), // spec version
|
(), // spec version
|
||||||
(), // tx version
|
(), // tx version
|
||||||
(), // genesis
|
(), // genesis
|
||||||
era, // era
|
era, // era
|
||||||
nonce, // nonce (compact encoding)
|
nonce.into(), // nonce (compact encoding)
|
||||||
(), // Check weight
|
(), // Check weight
|
||||||
tip, // transaction payment / tip (compact encoding)
|
tip.into(), // transaction payment / tip (compact encoding)
|
||||||
),
|
),
|
||||||
additional_signed: (
|
additional_signed: (
|
||||||
version.spec_version,
|
version.spec_version,
|
||||||
|
|||||||
@@ -84,7 +84,12 @@ impl TransactionSignScheme for Rococo {
|
|||||||
let signer: sp_runtime::MultiSigner = signer.public().into();
|
let signer: sp_runtime::MultiSigner = signer.public().into();
|
||||||
let (call, extra, _) = raw_payload.deconstruct();
|
let (call, extra, _) = raw_payload.deconstruct();
|
||||||
|
|
||||||
bp_rococo::UncheckedExtrinsic::new_signed(call, signer.into_account(), signature.into(), extra)
|
bp_rococo::UncheckedExtrinsic::new_signed(
|
||||||
|
call,
|
||||||
|
sp_runtime::MultiAddress::Id(signer.into_account()),
|
||||||
|
signature.into(),
|
||||||
|
extra,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,12 @@ impl TransactionSignScheme for Westend {
|
|||||||
let signer: sp_runtime::MultiSigner = signer.public().into();
|
let signer: sp_runtime::MultiSigner = signer.public().into();
|
||||||
let (call, extra, _) = raw_payload.deconstruct();
|
let (call, extra, _) = raw_payload.deconstruct();
|
||||||
|
|
||||||
bp_westend::UncheckedExtrinsic::new_signed(call, signer.into_account(), signature.into(), extra)
|
bp_westend::UncheckedExtrinsic::new_signed(
|
||||||
|
call,
|
||||||
|
sp_runtime::MultiAddress::Id(signer.into_account()),
|
||||||
|
signature.into(),
|
||||||
|
extra,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user