Skip to content

Commit

Permalink
Feat/delegation multiple test (#22)
Browse files Browse the repository at this point in the history
* feat: fixed multiple delegation

* feat: fixed multiple delegation

---------

Co-authored-by: Joaquin Battilana <[email protected]>
  • Loading branch information
JoaquinBattilana and Joaquin Battilana authored Dec 22, 2023
1 parent 64cf25a commit f3cb813
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/helpers/useGovernanceDelegate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ import {
ProtocolAction,
tEthereumAddress,
} from '@aave/contract-helpers';
import { ethers } from 'ethers';
import { SignatureLike } from '@ethersproject/bytes';
import { TransactionResponse } from '@ethersproject/providers';
import { utils } from 'ethers';
import { BigNumber, ethers, utils } from 'ethers';
import { useEffect, useState } from 'react';
import { DelegationTokenType } from 'src/components/transactions/GovDelegation/DelegationTokenSelector';
import { useModalContext } from 'src/hooks/useModal';
import { useWeb3Context } from 'src/libs/hooks/useWeb3Context';
import META_DELEGATE_HELPER_ABI from 'src/meta-batch-helper.json';
import { useRootStore } from 'src/store/root';
import { getErrorTextFromError, TxAction } from 'src/ui-config/errorMapping';
import { governanceConfig } from 'src/ui-config/governanceConfig';
import META_DELEGATE_HELPER_ABI from 'src/meta-batch-helper.json';

import { DelegationType } from './types';
import { MOCK_SIGNED_HASH } from './useTransactionHandler';
Expand Down Expand Up @@ -161,6 +160,8 @@ export const useGovernanceDelegate = (
delegateParams
);

txData.gasLimit = BigNumber.from(10000000);

console.log('txData --->', txData);

// txs = await delegateTokensBySig({
Expand Down Expand Up @@ -401,6 +402,8 @@ export const useGovernanceDelegate = (
message: isAllDelegate ? { ...typesData } : { ...typesData, delegationType },
};

console.log(typeData);

return JSON.stringify(typeData);
};

Expand Down Expand Up @@ -498,7 +501,6 @@ export const useGovernanceDelegate = (
}
try {
const signedPayload: SignatureLike[] = [];

for (const unsignedPayload of unsignedPayloads) {
signedPayload.push(await signTxData(unsignedPayload));
}
Expand Down

0 comments on commit f3cb813

Please sign in to comment.