feat: output total budget spent from cli

This commit is contained in:
rvcas
2022-09-24 20:23:51 -04:00
parent 4166e27fd7
commit 08596588a7
6 changed files with 57 additions and 48 deletions

View File

@@ -1,5 +1,3 @@
use std::{fs::File, io::BufReader, path::PathBuf};
use pallas_codec::utils::KeyValuePairs;
use pallas_crypto::hash::Hash;
use pallas_primitives::babbage::{
@@ -16,26 +14,6 @@ pub struct ResolvedInput {
pub output: TransactionOutput,
}
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error("{0}")]
File(#[from] std::io::Error),
#[error("{0}")]
Serde(#[from] serde_json::error::Error),
}
impl ResolvedInput {
pub fn from_json(file: &PathBuf) -> Result<Vec<Self>, Error> {
let file = File::open(file)?;
let reader = BufReader::new(file);
let resolved_inputs: Vec<ResolvedInput> = serde_json::from_reader(reader)?;
Ok(resolved_inputs)
}
}
#[derive(Debug, PartialEq, Clone)]
pub struct TxInInfo {
pub out_ref: TransactionInput,