Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renders fee and expiration in unsigned transaction summary #5556

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions ironfish-cli/src/utils/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ export async function renderTransactionDetails(

await _renderTransactionDetails(
client,
transaction.fee(),
transaction.expiration(),
transaction.mints,
transaction.burns,
account,
Expand All @@ -148,6 +150,8 @@ export async function renderUnsignedTransactionDetails(

await _renderTransactionDetails(
client,
unsignedTransaction.fee(),
unsignedTransaction.expiration(),
unsignedTransaction.mints,
unsignedTransaction.burns,
account,
Expand All @@ -158,6 +162,8 @@ export async function renderUnsignedTransactionDetails(

async function _renderTransactionDetails(
client: RpcClient,
fee: bigint,
expiration: number,
mints: MintDescription[],
burns: BurnDescription[],
account?: string,
Expand All @@ -169,6 +175,14 @@ async function _renderTransactionDetails(
const assetIds = collectAssetIds(mints, burns, notes)
const assetLookup = await getAssetVerificationByIds(client, assetIds, account, undefined)

logger.log('')
logger.log('===================')
logger.log('Transaction Summary')
logger.log('===================')
logger.log('')
logger.log(`Fee ${CurrencyUtils.render(fee, true)}`)
logger.log(`Expiration ${expiration}`)

if (mints.length > 0) {
logger.log('')
logger.log('==================')
Expand Down
8 changes: 8 additions & 0 deletions ironfish/src/primitives/unsignedTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,12 @@ export class UnsignedTransaction {
this.returnReference()
return publicKeyRandomness
}

fee(): bigint {
return this._fee
}

expiration(): number {
return this._expiration
}
}