chore(utxorpc): update spec to v0.14 and update redeemer mapper (#559)
Co-authored-by: ricomiles <ricoquiblat@gmail.com>
This commit is contained in:
parent
2864ff45a9
commit
227b5781a9
4 changed files with 49 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
|
|
||||||
|
use pallas_codec::minicbor;
|
||||||
use pallas_primitives::{alonzo, conway};
|
use pallas_primitives::{alonzo, conway};
|
||||||
|
|
||||||
use crate::MultiEraRedeemer;
|
use crate::MultiEraRedeemer;
|
||||||
|
|
@ -78,4 +79,11 @@ impl<'b> MultiEraRedeemer<'b> {
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn encode(&self) -> Vec<u8> {
|
||||||
|
match self {
|
||||||
|
MultiEraRedeemer::AlonzoCompatible(x) => minicbor::to_vec(x).unwrap(),
|
||||||
|
MultiEraRedeemer::Conway(k, v) => minicbor::to_vec((k, v)).unwrap(),
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ authors = ["Santiago Carmuega <santiago@carmuega.me>"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# utxorpc-spec = { path = "../../../utxorpc/spec/gen/rust" }
|
# utxorpc-spec = { path = "../../../utxorpc/spec/gen/rust" }
|
||||||
utxorpc-spec = { version = "0.11.0" }
|
utxorpc-spec = { version = "0.14.0" }
|
||||||
|
|
||||||
pallas-traverse = { version = "=0.31.0", path = "../pallas-traverse" }
|
pallas-traverse = { version = "=0.31.0", path = "../pallas-traverse" }
|
||||||
pallas-primitives = { version = "=0.31.0", path = "../pallas-primitives" }
|
pallas-primitives = { version = "=0.31.0", path = "../pallas-primitives" }
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,12 @@ impl<C: LedgerContext> Mapper<C> {
|
||||||
u5c::Redeemer {
|
u5c::Redeemer {
|
||||||
purpose: self.map_purpose(&x.tag()).into(),
|
purpose: self.map_purpose(&x.tag()).into(),
|
||||||
payload: self.map_plutus_datum(x.data()).into(),
|
payload: self.map_plutus_datum(x.data()).into(),
|
||||||
|
index: x.index().into(),
|
||||||
|
ex_units: Some(u5c::ExUnits {
|
||||||
|
steps: x.ex_units().steps,
|
||||||
|
memory: x.ex_units().mem,
|
||||||
|
}),
|
||||||
|
original_cbor: x.encode().into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,11 @@
|
||||||
"inputs": [
|
"inputs": [
|
||||||
{
|
{
|
||||||
"redeemer": {
|
"redeemer": {
|
||||||
|
"exUnits": {
|
||||||
|
"memory": "2893153",
|
||||||
|
"steps": "1254988362"
|
||||||
|
},
|
||||||
|
"originalCbor": "hAAAGgAtxsCCGgAsJWEaSs2aSg==",
|
||||||
"payload": {
|
"payload": {
|
||||||
"bigInt": {
|
"bigInt": {
|
||||||
"int": "3000000"
|
"int": "3000000"
|
||||||
|
|
@ -33,6 +38,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"redeemer": {
|
"redeemer": {
|
||||||
|
"exUnits": {
|
||||||
|
"memory": "29039",
|
||||||
|
"steps": "9759373"
|
||||||
|
},
|
||||||
|
"index": 1,
|
||||||
|
"originalCbor": "hAAB2HmAghlxbxoAlOqN",
|
||||||
"payload": {
|
"payload": {
|
||||||
"constr": {
|
"constr": {
|
||||||
"tag": 121
|
"tag": 121
|
||||||
|
|
@ -45,6 +56,12 @@
|
||||||
{
|
{
|
||||||
"outputIndex": 2,
|
"outputIndex": 2,
|
||||||
"redeemer": {
|
"redeemer": {
|
||||||
|
"exUnits": {
|
||||||
|
"memory": "23776",
|
||||||
|
"steps": "8949203"
|
||||||
|
},
|
||||||
|
"index": 2,
|
||||||
|
"originalCbor": "hAAC2HmAghlc4BoAiI3T",
|
||||||
"payload": {
|
"payload": {
|
||||||
"constr": {
|
"constr": {
|
||||||
"tag": 121
|
"tag": 121
|
||||||
|
|
@ -1384,6 +1401,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"redeemer": {
|
"redeemer": {
|
||||||
|
"exUnits": {
|
||||||
|
"memory": "862260",
|
||||||
|
"steps": "283080173"
|
||||||
|
},
|
||||||
|
"index": 1,
|
||||||
|
"originalCbor": "hAAB2HmAghoADSg0GhDfde0=",
|
||||||
"payload": {
|
"payload": {
|
||||||
"constr": {
|
"constr": {
|
||||||
"tag": 121
|
"tag": 121
|
||||||
|
|
@ -2018,6 +2041,12 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"redeemer": {
|
"redeemer": {
|
||||||
|
"exUnits": {
|
||||||
|
"memory": "312977",
|
||||||
|
"steps": "151500123"
|
||||||
|
},
|
||||||
|
"index": 1,
|
||||||
|
"originalCbor": "hAAB2HqfUCgL7p8Ifi1y1Y0n3fHPaAb/ghoABMaRGgkHtVs=",
|
||||||
"payload": {
|
"payload": {
|
||||||
"constr": {
|
"constr": {
|
||||||
"fields": [
|
"fields": [
|
||||||
|
|
@ -2043,6 +2072,11 @@
|
||||||
],
|
],
|
||||||
"policyId": "J5+ELDPu2QVLnjxwzWo7MimCWcJLeLiVy0HZGg==",
|
"policyId": "J5+ELDPu2QVLnjxwzWo7MimCWcJLeLiVy0HZGg==",
|
||||||
"redeemer": {
|
"redeemer": {
|
||||||
|
"exUnits": {
|
||||||
|
"memory": "56931",
|
||||||
|
"steps": "22622736"
|
||||||
|
},
|
||||||
|
"originalCbor": "hAEA2HmAghneYxoBWTIQ",
|
||||||
"payload": {
|
"payload": {
|
||||||
"constr": {
|
"constr": {
|
||||||
"tag": 121
|
"tag": 121
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue