fix: changes from pallas bump

Co-authored-by: Kasey White <kwhitemsg@gmail.com>
This commit is contained in:
rvcas
2022-09-14 21:59:16 -04:00
parent 336af376e1
commit 348ed3b719
7 changed files with 102 additions and 120 deletions

View File

@@ -1,4 +1,4 @@
use std::{collections::BTreeMap, ops::Deref};
use std::ops::Deref;
use pallas_primitives::babbage::{BigInt, Constr, PlutusData};
@@ -693,14 +693,14 @@ impl DefaultFunction {
},
DefaultFunction::MapData => match &args[0] {
Value::Con(Constant::ProtoList(_, list)) => {
let mut map = BTreeMap::new();
let mut map = Vec::new();
for item in list {
match item {
Constant::ProtoPair(Type::Data, Type::Data, left, right) => {
match (*left.clone(), *right.clone()) {
(Constant::Data(key), Constant::Data(value)) => {
map.insert(key, value);
map.push((key, value));
}
_ => unreachable!(),
}
@@ -709,7 +709,7 @@ impl DefaultFunction {
}
}
Ok(Value::Con(Constant::Data(PlutusData::Map(map))))
Ok(Value::Con(Constant::Data(PlutusData::Map(map.into()))))
}
_ => unreachable!(),
},