Skip to content

Commit

Permalink
fix: mana accuracy in transaction details (#8504)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpl121 authored May 7, 2024
1 parent 6334d14 commit b1c0f29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/shared/lib/core/api/interfaces/api.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type {
ProtocolParameters,
DecayedMana,
DelegationId,
SlotIndex,
} from '@iota/sdk/out/types'
import { IWallet } from '@core/profile/interfaces'

Expand Down Expand Up @@ -48,4 +49,5 @@ export interface IApi {
computeOutputId(id: TransactionId, index: number): OutputId
computeDelegationId(outputId: OutputId): DelegationId
outputHexBytes(output: Output): HexEncodedString
computeSlotIndex(requestId: HexEncodedString): SlotIndex
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export function getPassiveManaForOutput(output: OutputData, slotIndex?: number):
: _nodeInfo.status?.latestConfirmedBlockSlot ?? undefined
}
if (slotIndex === undefined) return

const includedSlot = api.computeSlotIndex(output.metadata.included.transactionId)
const decayedMana = api.outputManaWithDecay(
output.output,
output.metadata.included.slot,
includedSlot,
slotIndex,
_nodeInfo.protocolParameters[0].parameters
)
Expand Down

0 comments on commit b1c0f29

Please sign in to comment.