mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
Encode and estimate Rococo/Wococo/Kusama/Polkadot messages (#1322)
* encode and estimate Rococo/Wococo/Kusama/Polkadot messages * allow send-message for non-bundled chains * weight -> dispatch-weight * fmt * fix spelling
This commit is contained in:
committed by
Bastian Köcher
parent
097a28418b
commit
efa3e97210
@@ -20,8 +20,8 @@ use bp_messages::MessageNonce;
|
||||
use codec::Encode;
|
||||
use frame_support::weights::Weight;
|
||||
use relay_substrate_client::{
|
||||
Chain, ChainBase, ChainWithBalances, ChainWithGrandpa, ChainWithMessages, SignParam,
|
||||
TransactionSignScheme, UnsignedTransaction,
|
||||
Chain, ChainBase, ChainWithBalances, ChainWithGrandpa, ChainWithMessages,
|
||||
Error as SubstrateError, SignParam, TransactionSignScheme, UnsignedTransaction,
|
||||
};
|
||||
use sp_core::{storage::StorageKey, Pair};
|
||||
use sp_runtime::{generic::SignedPayload, traits::IdentifyAccount};
|
||||
@@ -101,7 +101,7 @@ impl TransactionSignScheme for Kusama {
|
||||
type AccountKeyPair = sp_core::sr25519::Pair;
|
||||
type SignedTransaction = crate::runtime::UncheckedExtrinsic;
|
||||
|
||||
fn sign_transaction(param: SignParam<Self>) -> Self::SignedTransaction {
|
||||
fn sign_transaction(param: SignParam<Self>) -> Result<Self::SignedTransaction, SubstrateError> {
|
||||
let raw_payload = SignedPayload::new(
|
||||
param.unsigned.call.clone(),
|
||||
bp_kusama::SignedExtensions::new(
|
||||
@@ -119,12 +119,12 @@ impl TransactionSignScheme for Kusama {
|
||||
let signer: sp_runtime::MultiSigner = param.signer.public().into();
|
||||
let (call, extra, _) = raw_payload.deconstruct();
|
||||
|
||||
bp_kusama::UncheckedExtrinsic::new_signed(
|
||||
Ok(bp_kusama::UncheckedExtrinsic::new_signed(
|
||||
call,
|
||||
sp_runtime::MultiAddress::Id(signer.into_account()),
|
||||
signature.into(),
|
||||
extra,
|
||||
)
|
||||
))
|
||||
}
|
||||
|
||||
fn is_signed(tx: &Self::SignedTransaction) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user