Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
martykan committed Feb 11, 2025
1 parent 6f8b00d commit 5932ddd
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ describe('useSendForm hook', () => {
it(
`changeFee: ${f.description}`,
async () => {
console.log('test changeFee -', f.description);
testMocks.setTrezorConnectFixtures(f.connect);
const store = initStore(f.store);
const callback: TestCallback = {};
Expand Down
1 change: 1 addition & 0 deletions packages/suite/src/hooks/wallet/form/useCompose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export const useCompose = <TFieldValues extends FormState>({
// trigger initial compose process
useEffect(() => {
if (state && composeRequestIDRef.current === 0) {
console.log('initial compose');
composeRequest();
}
}, [state, composeRequest]);
Expand Down
2 changes: 2 additions & 0 deletions packages/suite/src/hooks/wallet/form/useFees.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const useFees = <TFieldValues extends FormState>({

// compose
if (updateField) {
console.log('update in useFees');
if (composeRequest) {
composeRequest(updateField);
}
Expand Down Expand Up @@ -140,6 +141,7 @@ export const useFees = <TFieldValues extends FormState>({
feePerUnit = '';
feeLimit = '';
clearErrors(['feePerUnit', 'feeLimit']);
console.log('changeFeeLevel');
composeRequest();
}

Expand Down
3 changes: 3 additions & 0 deletions packages/suite/src/hooks/wallet/useSendForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export const useSendForm = (props: UseSendFormProps): SendContextValues => {
validateImportedTransaction(async () => {
const valid = await trigger();
if (valid) {
console.log('import tx');
composeRequest();
}
});
Expand Down Expand Up @@ -315,6 +316,7 @@ export const useSendForm = (props: UseSendFormProps): SendContextValues => {
});
}
dispatch(fillSendForm(false));
console.log('fill using protocol');
composeRequest();
}
}, [
Expand Down Expand Up @@ -368,6 +370,7 @@ export const useSendForm = (props: UseSendFormProps): SendContextValues => {
}, [dispatch, draftSaveRequest, setDraftSaveRequest, getValues, formState.errors]);

useDidUpdate(() => {
console.log('useDidUpdate');
const { outputs } = getValues();

const conversionToUse = shouldSendInSats ? amountToSmallestUnit : formatAmount;
Expand Down
1 change: 1 addition & 0 deletions packages/suite/src/hooks/wallet/useSendFormCompose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const useSendFormCompose = ({
// store current request ID before async debounced process and compare it later. see explanation below
const resultID = composeRequestID.current;
const result = await debounce(() => {
console.log('useSendFormCompose - debounce');
if (Object.keys(errors).length > 0) {
return Promise.resolve(undefined);
}
Expand Down
1 change: 1 addition & 0 deletions packages/suite/src/support/tests/hooksHelper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const actionSequence = <A extends UserAction[]>(
return actions.reduce(
(p, action) =>
p.then(async () => {
console.log('action', action.type, action.element);
const element = findByTestId(action.element);
if (action.type === 'hover') {
await user.hover(element);
Expand Down

0 comments on commit 5932ddd

Please sign in to comment.