Skip to content

Commit 45267c9

Browse files
committed
pset: input: insert non-pset proprietary keys
As it is done for pset outputs.
1 parent 7ead9ba commit 45267c9

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/pset/elip101.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ mod test {
134134
let bytes = encode::serialize(&pset);
135135
let pset_back = encode::deserialize::<PartiallySignedTransaction>(&bytes).unwrap();
136136
// Check the abf
137-
// FIXME: input abf should be there
138-
assert!(pset_back.inputs()[0].get_abf().is_none());
137+
assert_eq!(pset_back.inputs()[0].get_abf().unwrap().unwrap(), abf);
139138
assert_eq!(pset_back.outputs()[0].get_abf().unwrap().unwrap(), abf);
140139
}
141140
}

src/pset/map/input.rs

+10
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)