Skip to content

Commit 39e6e41

Browse files
committed
[DDW-1076] add more logs
1 parent 52ae995 commit 39e6e41

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

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

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ type State = {
140140
hasPendingRequestTokens: boolean;
141141
adaInputState: AdaInputState;
142142
coinSelection?: CoinSelectionsResponse;
143+
coinSelections?: Array<{
144+
adaAmount: number;
145+
coinSelection: CoinSelectionsResponse;
146+
}>;
143147
adaAmount: number;
144148
};
145149

@@ -159,7 +163,7 @@ class WalletSendForm extends Component<Props, State> {
159163
validationDebounceWait: FORM_VALIDATION_DEBOUNCE_WAIT,
160164
};
161165

162-
state = {
166+
state: State = {
163167
formFields: {} as State['formFields'],
164168
minimumAda: new BigNumber(0),
165169
adaAmountInputTrack: new BigNumber(0),
@@ -174,6 +178,7 @@ class WalletSendForm extends Component<Props, State> {
174178
hasPendingRequestTokens: false,
175179
coinSelection: null,
176180
adaAmount: 0,
181+
coinSelections: [],
177182
};
178183
// We need to track the mounted state in order to avoid calling
179184
// setState promise handling code after the component was already unmounted:
@@ -663,6 +668,10 @@ class WalletSendForm extends Component<Props, State> {
663668
adaInputState: this.state.adaInputState,
664669
coinSelection,
665670
adaAmount,
671+
coinSelections: [
672+
...this.state.coinSelections,
673+
{ adaAmount, coinSelection },
674+
],
666675
};
667676

668677
if (shouldUpdateMinimumAdaAmount) {
@@ -1340,6 +1349,38 @@ class WalletSendForm extends Component<Props, State> {
13401349
</div>
13411350
</BorderedBox>
13421351
)}
1352+
{this.state.coinSelections.map((c, idx) => (
1353+
<div
1354+
style={{
1355+
margin: '20px',
1356+
border: '1px dashed #333',
1357+
}}
1358+
key={idx}
1359+
>
1360+
<b>ada amount: {c.adaAmount}</b>
1361+
<br />
1362+
<b>inputs:</b>
1363+
<p
1364+
style={{
1365+
whiteSpace: 'break-spaces',
1366+
lineHeight: '20px',
1367+
fontSize: '14px',
1368+
}}
1369+
>
1370+
{JSON.stringify(c.coinSelection.inputs, null, 2)}
1371+
</p>
1372+
<b>outputs:</b>
1373+
<p
1374+
style={{
1375+
whiteSpace: 'break-spaces',
1376+
lineHeight: '20px',
1377+
fontSize: '14px',
1378+
}}
1379+
>
1380+
{JSON.stringify(c.coinSelection.outputs, null, 2)}
1381+
</p>
1382+
</div>
1383+
))}
13431384

13441385
{isDialogOpen(WalletSendConfirmationDialogView) &&
13451386
confirmationDialogData ? (
@@ -1364,7 +1405,6 @@ class WalletSendForm extends Component<Props, State> {
13641405
coinSelection={confirmationDialogData.coinSelection}
13651406
/>
13661407
) : null}
1367-
13681408
{isDialogOpen(WalletTokenPicker) && (
13691409
<WalletTokenPicker
13701410
assets={assets}

0 commit comments

Comments
 (0)