chore: bump pallas version
This commit is contained in:
parent
806d98e5fc
commit
336af376e1
|
@ -54,12 +54,6 @@ version = "0.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581"
|
checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bech32"
|
|
||||||
version = "0.8.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bech32"
|
name = "bech32"
|
||||||
version = "0.9.1"
|
version = "0.9.1"
|
||||||
|
@ -258,34 +252,14 @@ dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "minicbor"
|
|
||||||
version = "0.17.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "a5e575910763b21a0db7df5e142907fe944bff84d1dfc78e2ba92e7f3bdfd36b"
|
|
||||||
dependencies = [
|
|
||||||
"half",
|
|
||||||
"minicbor-derive 0.11.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minicbor"
|
name = "minicbor"
|
||||||
version = "0.18.0"
|
version = "0.18.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2a20020e8e2d1881d8736f64011bb5ff99f1db9947ce3089706945c8915695cb"
|
checksum = "2a20020e8e2d1881d8736f64011bb5ff99f1db9947ce3089706945c8915695cb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"minicbor-derive 0.12.0",
|
"half",
|
||||||
]
|
"minicbor-derive",
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "minicbor-derive"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d0a86c5f04def8fb7735ae918bb589af82f985526f4c62e0249544b668b2f456"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -316,12 +290,12 @@ checksum = "029d8d0b2f198229de29dca79676f2738ff952edf3fde542eb8bf94d8c21b435"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pallas-addresses"
|
name = "pallas-addresses"
|
||||||
version = "0.13.2"
|
version = "0.14.0-alpha.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712ead72b4f40d09f1c8660c47340489862754609cc2d587f24874ce55e51492"
|
checksum = "5caad3c874e1b6235c3a27a7e25497289392eabbd977e006863caf8ef3652e57"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base58",
|
"base58",
|
||||||
"bech32 0.8.1",
|
"bech32",
|
||||||
"hex",
|
"hex",
|
||||||
"pallas-codec",
|
"pallas-codec",
|
||||||
"pallas-crypto",
|
"pallas-crypto",
|
||||||
|
@ -330,34 +304,37 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pallas-codec"
|
name = "pallas-codec"
|
||||||
version = "0.13.2"
|
version = "0.14.0-alpha.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1758a68b9b2332a24403cf484ea2dd05dd14cceeb6f7b63cb8d11137865fb4cf"
|
checksum = "8ac4f8895300b80ef2e624373f6421a9cb81523508bc48400f15db7876ec52ea"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"minicbor 0.17.1",
|
"hex",
|
||||||
|
"minicbor",
|
||||||
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pallas-crypto"
|
name = "pallas-crypto"
|
||||||
version = "0.13.2"
|
version = "0.14.0-alpha.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e17a13efbe2609916de03c063d5bbef840616b02c658f3db5222785a18b63362"
|
checksum = "2c0a5b31037a97528e10feca6d208a21022f1c6d7837017915a43fae57be99dc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cryptoxide",
|
"cryptoxide",
|
||||||
"hex",
|
"hex",
|
||||||
"pallas-codec",
|
"pallas-codec",
|
||||||
"rand_core",
|
"rand_core",
|
||||||
|
"serde",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pallas-primitives"
|
name = "pallas-primitives"
|
||||||
version = "0.13.2"
|
version = "0.14.0-alpha.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "24f8d900bac04b711d2c4b21e906680224efd02d312a87ce25e688595b91d1fc"
|
checksum = "a8d2f217857eeccd37ad9fad3cdfc8288d8d2bc41e5c93e7f5f6b3c688873068"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base58",
|
"base58",
|
||||||
"bech32 0.9.1",
|
"bech32",
|
||||||
"hex",
|
"hex",
|
||||||
"log",
|
"log",
|
||||||
"pallas-codec",
|
"pallas-codec",
|
||||||
|
@ -368,9 +345,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pallas-traverse"
|
name = "pallas-traverse"
|
||||||
version = "0.13.2"
|
version = "0.14.0-alpha.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0549db2f8bbaf22d13fc35791dd50fb13a50a1290a342a98929c8ce6c422ed86"
|
checksum = "d4d32519a431ecc6c02507608cee4b75e06518a1cfdfcdd1b13cb7d0b07f638a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hex",
|
"hex",
|
||||||
"pallas-addresses",
|
"pallas-addresses",
|
||||||
|
@ -702,7 +679,7 @@ dependencies = [
|
||||||
"cryptoxide",
|
"cryptoxide",
|
||||||
"flat-rs",
|
"flat-rs",
|
||||||
"hex",
|
"hex",
|
||||||
"minicbor 0.18.0",
|
"minicbor",
|
||||||
"pallas-codec",
|
"pallas-codec",
|
||||||
"pallas-primitives",
|
"pallas-primitives",
|
||||||
"peg",
|
"peg",
|
||||||
|
|
|
@ -14,11 +14,11 @@ authors = ["Lucas Rosa <x@rvcas.dev>", "Kasey White <kwhitemsg@gmail.com>"]
|
||||||
anyhow = "1.0.57"
|
anyhow = "1.0.57"
|
||||||
clap = { version = "3.1.14", features = ["derive"] }
|
clap = { version = "3.1.14", features = ["derive"] }
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
pallas-primitives = "0.13.2"
|
pallas-addresses = "0.14.0-alpha.2"
|
||||||
pallas-codec = "0.13.2"
|
pallas-codec = "0.14.0-alpha.2"
|
||||||
pallas-traverse = "0.13.2"
|
pallas-crypto = "0.14.0-alpha.2"
|
||||||
pallas-crypto = "0.13.2"
|
pallas-primitives = "0.14.0-alpha.2"
|
||||||
|
pallas-traverse = "0.14.0-alpha.2"
|
||||||
serde = { version = "1.0.144", features = ["derive"] }
|
serde = { version = "1.0.144", features = ["derive"] }
|
||||||
serde_json = "1.0.85"
|
serde_json = "1.0.85"
|
||||||
uplc = { path = '../uplc', version = "0.0.12" }
|
uplc = { path = '../uplc', version = "0.0.12" }
|
||||||
pallas-addresses = "0.13.2"
|
|
||||||
|
|
|
@ -17,8 +17,8 @@ cryptoxide = "0.4.2"
|
||||||
flat-rs = { path = "../flat", version = "0.0.10" }
|
flat-rs = { path = "../flat", version = "0.0.10" }
|
||||||
hex = "0.4.3"
|
hex = "0.4.3"
|
||||||
minicbor = { version = "0.18.0", features = ["std"] }
|
minicbor = { version = "0.18.0", features = ["std"] }
|
||||||
pallas-codec = "0.13.2"
|
pallas-codec = "0.14.0-alpha.2"
|
||||||
pallas-primitives = "0.13.2"
|
pallas-primitives = "0.14.0-alpha.2"
|
||||||
peg = "0.8.0"
|
peg = "0.8.0"
|
||||||
pretty = "0.11.3"
|
pretty = "0.11.3"
|
||||||
thiserror = "1.0.31"
|
thiserror = "1.0.31"
|
||||||
|
|
|
@ -488,9 +488,9 @@ impl Value {
|
||||||
PlutusData::Map(m) => {
|
PlutusData::Map(m) => {
|
||||||
let mut new_stack: VecDeque<&PlutusData>;
|
let mut new_stack: VecDeque<&PlutusData>;
|
||||||
// create new stack with of items from the list of pairs of data
|
// create new stack with of items from the list of pairs of data
|
||||||
new_stack = m.deref().iter().fold(VecDeque::new(), |mut acc, d| {
|
new_stack = m.iter().fold(VecDeque::new(), |mut acc, d| {
|
||||||
acc.push_back(&d.0);
|
acc.push_back(d.0);
|
||||||
acc.push_back(&d.1);
|
acc.push_back(d.1);
|
||||||
acc
|
acc
|
||||||
});
|
});
|
||||||
// Append old stack to the back of the new stack
|
// Append old stack to the back of the new stack
|
||||||
|
@ -499,7 +499,7 @@ impl Value {
|
||||||
}
|
}
|
||||||
PlutusData::BigInt(i) => {
|
PlutusData::BigInt(i) => {
|
||||||
if let BigInt::Int(g) = i {
|
if let BigInt::Int(g) = i {
|
||||||
let numb: i64 = (*g).try_into().unwrap();
|
let numb: i128 = (*g).try_into().unwrap();
|
||||||
total += Value::Con(Constant::Integer(numb as isize)).to_ex_mem();
|
total += Value::Con(Constant::Integer(numb as isize)).to_ex_mem();
|
||||||
} else {
|
} else {
|
||||||
unreachable!()
|
unreachable!()
|
||||||
|
@ -517,14 +517,6 @@ impl Value {
|
||||||
new_stack.append(&mut stack);
|
new_stack.append(&mut stack);
|
||||||
stack = new_stack;
|
stack = new_stack;
|
||||||
}
|
}
|
||||||
PlutusData::ArrayIndef(a) => {
|
|
||||||
// create new stack with of items from the list of data
|
|
||||||
let mut new_stack: VecDeque<&PlutusData> =
|
|
||||||
VecDeque::from_iter(a.deref().iter());
|
|
||||||
// Append old stack to the back of the new stack
|
|
||||||
new_stack.append(&mut stack);
|
|
||||||
stack = new_stack;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
total
|
total
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use std::ops::Deref;
|
use std::{collections::BTreeMap, ops::Deref};
|
||||||
|
|
||||||
use pallas_codec::utils::{KeyValuePairs, MaybeIndefArray};
|
|
||||||
use pallas_primitives::babbage::{BigInt, Constr, PlutusData};
|
use pallas_primitives::babbage::{BigInt, Constr, PlutusData};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -664,8 +663,7 @@ impl DefaultFunction {
|
||||||
DefaultFunction::ChooseData => match &args[0] {
|
DefaultFunction::ChooseData => match &args[0] {
|
||||||
Value::Con(Constant::Data(PlutusData::Constr(_))) => Ok(args[1].clone()),
|
Value::Con(Constant::Data(PlutusData::Constr(_))) => Ok(args[1].clone()),
|
||||||
Value::Con(Constant::Data(PlutusData::Map(_))) => Ok(args[2].clone()),
|
Value::Con(Constant::Data(PlutusData::Map(_))) => Ok(args[2].clone()),
|
||||||
Value::Con(Constant::Data(PlutusData::Array(_)))
|
Value::Con(Constant::Data(PlutusData::Array(_))) => Ok(args[3].clone()),
|
||||||
| Value::Con(Constant::Data(PlutusData::ArrayIndef(_))) => Ok(args[3].clone()),
|
|
||||||
Value::Con(Constant::Data(PlutusData::BigInt(_))) => Ok(args[4].clone()),
|
Value::Con(Constant::Data(PlutusData::BigInt(_))) => Ok(args[4].clone()),
|
||||||
Value::Con(Constant::Data(PlutusData::BoundedBytes(_))) => Ok(args[5].clone()),
|
Value::Con(Constant::Data(PlutusData::BoundedBytes(_))) => Ok(args[5].clone()),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
|
@ -687,7 +685,7 @@ impl DefaultFunction {
|
||||||
// TODO: handle other types of constructor tags
|
// TODO: handle other types of constructor tags
|
||||||
tag: convert_constr_to_tag(*i as u64),
|
tag: convert_constr_to_tag(*i as u64),
|
||||||
any_constructor: None,
|
any_constructor: None,
|
||||||
fields: MaybeIndefArray::Indef(data_list),
|
fields: data_list,
|
||||||
});
|
});
|
||||||
Ok(Value::Con(Constant::Data(constr_data)))
|
Ok(Value::Con(Constant::Data(constr_data)))
|
||||||
}
|
}
|
||||||
|
@ -695,21 +693,23 @@ impl DefaultFunction {
|
||||||
},
|
},
|
||||||
DefaultFunction::MapData => match &args[0] {
|
DefaultFunction::MapData => match &args[0] {
|
||||||
Value::Con(Constant::ProtoList(_, list)) => {
|
Value::Con(Constant::ProtoList(_, list)) => {
|
||||||
let data_list: Vec<(PlutusData, PlutusData)> = list
|
let mut map = BTreeMap::new();
|
||||||
.iter()
|
|
||||||
.map(|item| match item {
|
for item in list {
|
||||||
|
match item {
|
||||||
Constant::ProtoPair(Type::Data, Type::Data, left, right) => {
|
Constant::ProtoPair(Type::Data, Type::Data, left, right) => {
|
||||||
match (*left.clone(), *right.clone()) {
|
match (*left.clone(), *right.clone()) {
|
||||||
(Constant::Data(key), Constant::Data(value)) => (key, value),
|
(Constant::Data(key), Constant::Data(value)) => {
|
||||||
|
map.insert(key, value);
|
||||||
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
})
|
}
|
||||||
.collect();
|
}
|
||||||
Ok(Value::Con(Constant::Data(PlutusData::Map(
|
|
||||||
KeyValuePairs::Def(data_list),
|
Ok(Value::Con(Constant::Data(PlutusData::Map(map))))
|
||||||
))))
|
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
},
|
},
|
||||||
|
@ -722,9 +722,8 @@ impl DefaultFunction {
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
Ok(Value::Con(Constant::Data(PlutusData::ArrayIndef(
|
|
||||||
MaybeIndefArray::Indef(data_list),
|
Ok(Value::Con(Constant::Data(PlutusData::Array(data_list))))
|
||||||
))))
|
|
||||||
}
|
}
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
},
|
},
|
||||||
|
@ -779,8 +778,7 @@ impl DefaultFunction {
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
},
|
},
|
||||||
DefaultFunction::UnListData => match &args[0] {
|
DefaultFunction::UnListData => match &args[0] {
|
||||||
Value::Con(Constant::Data(PlutusData::Array(l)))
|
Value::Con(Constant::Data(PlutusData::Array(l))) => {
|
||||||
| Value::Con(Constant::Data(PlutusData::ArrayIndef(l))) => {
|
|
||||||
Ok(Value::Con(Constant::ProtoList(
|
Ok(Value::Con(Constant::ProtoList(
|
||||||
Type::Data,
|
Type::Data,
|
||||||
l.deref()
|
l.deref()
|
||||||
|
@ -794,7 +792,7 @@ impl DefaultFunction {
|
||||||
DefaultFunction::UnIData => match &args[0] {
|
DefaultFunction::UnIData => match &args[0] {
|
||||||
Value::Con(Constant::Data(PlutusData::BigInt(b))) => {
|
Value::Con(Constant::Data(PlutusData::BigInt(b))) => {
|
||||||
if let BigInt::Int(i) = b {
|
if let BigInt::Int(i) = b {
|
||||||
let x: i64 = (*i).try_into().unwrap();
|
let x: i128 = (*i).try_into().unwrap();
|
||||||
|
|
||||||
Ok(Value::Con(Constant::Integer(x as isize)))
|
Ok(Value::Con(Constant::Integer(x as isize)))
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue