feat: output total budget spent from cli
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user