feat: introduce UTxO RPC interop (#260)

This commit is contained in:
Santiago Carmuega 2023-06-11 03:52:48 +02:00 committed by GitHub
parent fb22d1b0e2
commit 4a849eec25
7 changed files with 515 additions and 1 deletions

View file

@ -81,7 +81,21 @@ impl<'b> MultiEraAsset<'b> {
}
}
pub fn coin(&self) -> i128 {
pub fn mint_coin(&self) -> Option<i64> {
match self {
MultiEraAsset::AlonzoCompatibleMint(_, _, x) => Some(*x),
MultiEraAsset::AlonzoCompatibleOutput(_, _, _) => None,
}
}
pub fn output_coin(&self) -> Option<u64> {
match self {
MultiEraAsset::AlonzoCompatibleOutput(_, _, x) => Some(*x),
MultiEraAsset::AlonzoCompatibleMint(_, _, _) => None,
}
}
pub fn any_coin(&self) -> i128 {
match self {
MultiEraAsset::AlonzoCompatibleOutput(_, _, x) => *x as i128,
MultiEraAsset::AlonzoCompatibleMint(_, _, x) => *x as i128,