fix: changes from pallas bump
Co-authored-by: Kasey White <kwhitemsg@gmail.com>
This commit is contained in:
@@ -16,9 +16,8 @@ exclude = ["test_data/*"]
|
||||
cryptoxide = "0.4.2"
|
||||
flat-rs = { path = "../flat", version = "0.0.10" }
|
||||
hex = "0.4.3"
|
||||
minicbor = { version = "0.18.0", features = ["std"] }
|
||||
pallas-codec = "0.14.0-alpha.2"
|
||||
pallas-primitives = "0.14.0-alpha.2"
|
||||
pallas-codec = { git = "https://github.com/txpipe/pallas" }
|
||||
pallas-primitives = { git = "https://github.com/txpipe/pallas" }
|
||||
peg = "0.8.0"
|
||||
pretty = "0.11.3"
|
||||
thiserror = "1.0.31"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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!(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user