Skip to content

Commit

Permalink
feat(rust-nodejs): Remove unused descriptions method (#4760)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanjadvani authored Feb 22, 2024
1 parent 116e6d8 commit 397d57c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 70 deletions.
14 changes: 0 additions & 14 deletions ironfish-rust-nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Buffer>): boolean
export interface NativeMintDescription {
assetId: string
value: bigint
}
export interface NativeBurnDescription {
assetId: string
value: bigint
}
export interface NativeUnsignedTransactionNotes {
outputs: Array<Buffer>
mints: Array<NativeMintDescription>
burns: Array<NativeBurnDescription>
}
export function aggregateSignatureShares(publicKeyPackageStr: string, signingPackageStr: string, signatureSharesArr: Array<string>): Buffer
export interface IdentityKeyPackage {
identity: string
Expand Down Expand Up @@ -259,7 +246,6 @@ export class UnsignedTransaction {
hash(): Buffer
signingPackage(nativeIdentiferCommitments: Array<string>): string
sign(spenderHexKey: string): Buffer
descriptions(): NativeUnsignedTransactionNotes
}
export class FoundBlockResult {
randomness: string
Expand Down
56 changes: 0 additions & 56 deletions ironfish-rust-nodejs/src/structs/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Buffer>,

pub mints: Vec<NativeMintDescription>,

pub burns: Vec<NativeBurnDescription>,
}

#[napi]
impl NativeUnsignedTransaction {
#[napi(constructor)]
Expand Down Expand Up @@ -490,39 +467,6 @@ impl NativeUnsignedTransaction {

Ok(Buffer::from(vec))
}

#[napi]
pub fn descriptions(&mut self) -> Result<NativeUnsignedTransactionNotes> {
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<u8> = vec![];
output.merkle_note().write(&mut vec).map_err(to_napi_err)?;

outputs.push(Buffer::from(vec));
}

Ok(NativeUnsignedTransactionNotes {
mints,
burns,
outputs,
})
}
}

#[napi]
Expand Down

0 comments on commit 397d57c

Please sign in to comment.