From 397d57ceb31fbf286315d34e0ca24b2cf855191e Mon Sep 17 00:00:00 2001 From: Rohan Jadvani <5459049+rohanjadvani@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:17:42 -0500 Subject: [PATCH] feat(rust-nodejs): Remove unused descriptions method (#4760) --- ironfish-rust-nodejs/index.d.ts | 14 ----- .../src/structs/transaction.rs | 56 ------------------- 2 files changed, 70 deletions(-) diff --git a/ironfish-rust-nodejs/index.d.ts b/ironfish-rust-nodejs/index.d.ts index 118ae69952..d2629da54c 100644 --- a/ironfish-rust-nodejs/index.d.ts +++ b/ironfish-rust-nodejs/index.d.ts @@ -52,19 +52,6 @@ export const TRANSACTION_EXPIRATION_LENGTH: number export const TRANSACTION_FEE_LENGTH: number export const LATEST_TRANSACTION_VERSION: number export function verifyTransactions(serializedTransactions: Array): boolean -export interface NativeMintDescription { - assetId: string - value: bigint -} -export interface NativeBurnDescription { - assetId: string - value: bigint -} -export interface NativeUnsignedTransactionNotes { - outputs: Array - mints: Array - burns: Array -} export function aggregateSignatureShares(publicKeyPackageStr: string, signingPackageStr: string, signatureSharesArr: Array): Buffer export interface IdentityKeyPackage { identity: string @@ -259,7 +246,6 @@ export class UnsignedTransaction { hash(): Buffer signingPackage(nativeIdentiferCommitments: Array): string sign(spenderHexKey: string): Buffer - descriptions(): NativeUnsignedTransactionNotes } export class FoundBlockResult { randomness: string diff --git a/ironfish-rust-nodejs/src/structs/transaction.rs b/ironfish-rust-nodejs/src/structs/transaction.rs index df10f97c8b..6895fddf06 100644 --- a/ironfish-rust-nodejs/src/structs/transaction.rs +++ b/ironfish-rust-nodejs/src/structs/transaction.rs @@ -386,29 +386,6 @@ pub struct NativeUnsignedTransaction { transaction: UnsignedTransaction, } -#[napi(object)] -pub struct NativeMintDescription { - pub asset_id: String, - - pub value: BigInt, -} - -#[napi(object)] -pub struct NativeBurnDescription { - pub asset_id: String, - - pub value: BigInt, -} - -#[napi(object)] -pub struct NativeUnsignedTransactionNotes { - pub outputs: Vec, - - pub mints: Vec, - - pub burns: Vec, -} - #[napi] impl NativeUnsignedTransaction { #[napi(constructor)] @@ -490,39 +467,6 @@ impl NativeUnsignedTransaction { Ok(Buffer::from(vec)) } - - #[napi] - pub fn descriptions(&mut self) -> Result { - let mut mints = Vec::new(); - for mint in self.transaction.mints().iter() { - mints.push(NativeMintDescription { - asset_id: bytes_to_hex(mint.description().asset.id().as_bytes()), - value: mint.description().value.into(), - }); - } - - let mut burns = Vec::new(); - for burn in self.transaction.burns().iter() { - burns.push(NativeBurnDescription { - asset_id: bytes_to_hex(burn.asset_id.as_bytes()), - value: burn.value.into(), - }); - } - - let mut outputs = Vec::new(); - for output in self.transaction.outputs().iter() { - let mut vec: Vec = vec![]; - output.merkle_note().write(&mut vec).map_err(to_napi_err)?; - - outputs.push(Buffer::from(vec)); - } - - Ok(NativeUnsignedTransactionNotes { - mints, - burns, - outputs, - }) - } } #[napi]