Skip to content

Commit 8b1c7fd

Browse files
committed
pset: input: insert non-pset proprietary keys
As it is done for pset outputs.
1 parent 4a61f71 commit 8b1c7fd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/pset/elip101.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ mod test {
132132
let bytes = encode::serialize(&pset);
133133
let pset_back = encode::deserialize::<PartiallySignedTransaction>(&bytes).unwrap();
134134
// Check the abf
135-
// FIXME: input abf should be there
136-
assert!(pset_back.inputs()[0].get_abf().is_none());
135+
assert_eq!(pset_back.inputs()[0].get_abf().unwrap().unwrap(), abf);
137136
assert_eq!(pset_back.outputs()[0].get_abf().unwrap().unwrap(), abf);
138137
}
139138
}

src/pset/map/input.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,18 @@ impl Map for Input {
759759
Entry::Occupied(_) => return Err(Error::DuplicateKey(raw_key).into()),
760760
},
761761
}
762+
} else {
763+
match self.proprietary.entry(prop_key) {
764+
Entry::Vacant(empty_key) => {
765+
empty_key.insert(raw_value);
766+
}
767+
Entry::Occupied(_) => {
768+
return Err(Error::DuplicateKey(raw_key).into())
769+
}
770+
}
762771
}
763772
}
773+
764774
_ => match self.unknown.entry(raw_key) {
765775
Entry::Vacant(empty_key) => {
766776
empty_key.insert(raw_value);

0 commit comments

Comments
 (0)