Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exclude = ["/for_tests", "/.github"]
[dependencies]
bitvec = { version = "1.0.1", default-features = false, features = ["alloc"] }
external-memory-tools = { version = "0.1.1", default-features = false }
frame-metadata = { version = "18.0.0", default-features = false, features = [
frame-metadata = { version = "23.0.0", default-features = false, features = [
"current",
"decode",
] }
Expand Down
28 changes: 22 additions & 6 deletions src/fill_prepare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,12 +626,7 @@ impl TransactionToFill {

pub fn try_default_tip(&mut self) {
for extension in self.extensions.iter_mut() {
try_default_tip(&mut extension.content);
if let TypeContentToFill::Composite(ref mut fields_to_fill) = extension.content {
for field in fields_to_fill.iter_mut() {
try_default_tip(&mut field.type_to_fill.content);
}
}
try_default_tip_nested(&mut extension.content);
}
}

Expand Down Expand Up @@ -915,6 +910,18 @@ impl TransactionToFill {
Ok(None)
}

pub fn set_signature(&mut self, signature: &SignatureSr25519) {
if let TypeContentToFill::Variant(ref mut multisig) = self.signature.content {
match multisig.selected.fields_to_fill[0].type_to_fill.content {
TypeContentToFill::SpecialType(SpecialTypeToFill::SignatureSr25519(ref mut sr25519)) =>
*sr25519 = Some(SignatureSr25519(signature.0)),
TypeContentToFill::ArrayU8(ref mut sr25519) =>
sr25519.content = signature.0.to_vec(),
_ => {}
}
}
}

pub fn send_this_signed<E, M>(&self, metadata: &M) -> Result<Option<Vec<u8>>, ErrorFixMe<E, M>>
where
E: ExternalMemory,
Expand Down Expand Up @@ -1115,6 +1122,15 @@ fn nonce_got_filled(content: &mut TypeContentToFill, rpc_u32: u32) -> bool {
}
}

fn try_default_tip_nested(content: &mut TypeContentToFill) {
try_default_tip(content);
if let TypeContentToFill::Composite(ref mut fields_to_fill) = content {
for field in fields_to_fill.iter_mut() {
try_default_tip_nested(&mut field.type_to_fill.content);
}
}
}

fn try_default_tip(content: &mut TypeContentToFill) {
match content {
TypeContentToFill::Primitive(PrimitiveToFill::CompactUnsigned(
Expand Down
Loading