Skip to content

Commit c18ef26

Browse files
committed
[DDW-1076] Add coin selection log
1 parent 4ceb39c commit c18ef26

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

source/renderer/app/components/wallet/WalletSendForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ type Props = {
108108
walletName: string;
109109
onTokenPickerDialogOpen: (...args: Array<any>) => any;
110110
onTokenPickerDialogClose: (...args: Array<any>) => any;
111-
confirmationDialogData?: Omit<FormData, 'coinSelection'>;
111+
confirmationDialogData?: FormData;
112112
validationDebounceWait?: number;
113113
};
114114

@@ -1351,6 +1351,7 @@ class WalletSendForm extends Component<Props, State> {
13511351
currencyMaxFractionalDigits
13521352
)}
13531353
adaAmount={confirmationDialogData.adaAmount}
1354+
coinSelection={confirmationDialogData.coinSelection}
13541355
/>
13551356
) : null}
13561357

source/renderer/app/containers/wallet/WalletSendPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { CoinSelectionsResponse } from '../../api/transactions/types';
1818

1919
type Props = InjectedProps;
2020
type State = {
21-
formData: Omit<FormData, 'coinSelection'>;
21+
formData: FormData;
2222
};
2323

2424
@inject('stores', 'actions')
@@ -100,7 +100,7 @@ class WalletSendPage extends Component<Props, State> {
100100
});
101101
}
102102

103-
this.setState({ formData: data });
103+
this.setState({ formData: { ...data, coinSelection } });
104104
};
105105

106106
openTokenPickerDialog = () => {

source/renderer/app/containers/wallet/dialogs/send-confirmation/SendConfirmation.container.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const Containter = ({
1919
isHardwareWallet,
2020
formattedTotalAmount,
2121
adaAmount,
22+
coinSelection,
2223
}: Props) => {
2324
const { isFlight } = global;
2425
const {
@@ -113,6 +114,7 @@ export const Containter = ({
113114
onTermsCheckboxClick={onTermsCheckboxClick}
114115
onExternalLinkClick={onExternalLinkClick}
115116
adaAmount={adaAmount}
117+
coinSelection={coinSelection}
116118
/>
117119
);
118120
};

source/renderer/app/containers/wallet/dialogs/send-confirmation/SendConfirmation.view.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const View = ({
4848
onTermsCheckboxClick,
4949
onCopyAssetParam,
5050
adaAmount,
51+
coinSelection,
5152
}: Props) => {
5253
const {
5354
passphraseField,
@@ -106,6 +107,27 @@ const View = ({
106107
closeButton={<DialogCloseButton />}
107108
>
108109
<b>ada amount: {adaAmount} </b>
110+
<br />
111+
<b>inputs:</b>
112+
<p
113+
style={{
114+
whiteSpace: 'break-spaces',
115+
lineHeight: '20px',
116+
fontSize: '14px',
117+
}}
118+
>
119+
{JSON.stringify(coinSelection.inputs, null, 2)}
120+
</p>
121+
<b>outputs:</b>{' '}
122+
<p
123+
style={{
124+
whiteSpace: 'break-spaces',
125+
lineHeight: '20px',
126+
fontSize: '14px',
127+
}}
128+
>
129+
{JSON.stringify(coinSelection.outputs, null, 2)}
130+
</p>
109131
{shouldShowEmptyWalletWarning(
110132
totalAmount,
111133
wallet,

source/renderer/app/containers/wallet/dialogs/send-confirmation/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BigNumber from 'bignumber.js';
22
import { Field } from 'mobx-react-form';
3+
import { CoinSelectionsResponse } from 'source/renderer/app/api/transactions/types';
34
import { Intl } from '../../../../types/i18nTypes';
45
import { StoresMap } from '../../../../stores/index';
56
import { ActionsMap } from '../../../../actions/index';
@@ -19,6 +20,7 @@ type CommonProps = {
1920
transactionFee: string | null | undefined;
2021
onExternalLinkClick: (...args: Array<any>) => any;
2122
adaAmount?: number;
23+
coinSelection?: CoinSelectionsResponse;
2224
};
2325

2426
export type ContainerProps = CommonProps & {

0 commit comments

Comments
 (0)