Skip to content

Commit d5dae5f

Browse files
committed
feat(core): add separate withdrawals to implicit coin
1 parent 8348bfd commit d5dae5f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Diff for: packages/core/src/Cardano/util/computeImplicitCoin.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import { CertificateType, HydratedTxBody, Lovelace } from '../types';
77
*/
88
export interface ImplicitCoin {
99
/**
10-
* Reward withdrawals + deposit reclaims
10+
* Reward withdrawals
11+
*/
12+
withdrawals?: Lovelace;
13+
/**
14+
* Reward withdrawals + deposit reclaims (total return)
1115
*/
1216
input?: Lovelace;
1317
/**
@@ -44,6 +48,7 @@ export const computeImplicitCoin = (
4448
);
4549
return {
4650
deposit,
47-
input: withdrawalsTotal + reclaimTotal
51+
input: withdrawalsTotal + reclaimTotal,
52+
withdrawals: withdrawalsTotal
4853
};
4954
};

Diff for: packages/core/test/Cardano/util/computeImplicitCoin.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ describe('Cardano.util.computeImplicitCoin', () => {
2424
const coin = Cardano.util.computeImplicitCoin(protocolParameters, { certificates, withdrawals });
2525
expect(coin.deposit).toBe(2n + 2n);
2626
expect(coin.input).toBe(2n + 3n + 5n);
27+
expect(coin.withdrawals).toBe(5n);
2728
});
2829
});

0 commit comments

Comments
 (0)