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

@@ -31,7 +31,7 @@ where
T: Binder<'b> + Debug,
{
pub fn from_cbor(bytes: &'b [u8], buffer: &'b mut Vec<u8>) -> Result<Self, de::Error> {
let mut cbor_decoder = minicbor::Decoder::new(bytes);
let mut cbor_decoder = pallas_codec::minicbor::Decoder::new(bytes);
let flat_bytes = cbor_decoder
.bytes()
@@ -63,7 +63,7 @@ where
let mut bytes = Vec::new();
let mut cbor_encoder = minicbor::Encoder::new(&mut bytes);
let mut cbor_encoder = pallas_codec::minicbor::Encoder::new(&mut bytes);
cbor_encoder
.bytes(&flat_bytes)

View File

@@ -489,8 +489,8 @@ impl Value {
let mut new_stack: VecDeque<&PlutusData>;
// create new stack with of items from the list of pairs of data
new_stack = m.iter().fold(VecDeque::new(), |mut acc, d| {
acc.push_back(d.0);
acc.push_back(d.1);
acc.push_back(&d.0);
acc.push_back(&d.1);
acc
});
// Append old stack to the back of the new stack

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!(),
},