Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmgdr committed Jun 6, 2024
1 parent c789021 commit f2be773
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lib/CeloWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default class CeloWallet extends Wallet {
*/
async estimateMaxFeeInFeeToken({gasLimit, maxFeePerGas, feeCurrency}: {gasLimit: bigint, maxFeePerGas: bigint, feeCurrency: string}) {
const maxGasFeesInCELO = gasLimit * maxFeePerGas
const [numerator, denominator] = await getConversionRateFromCeloToToken(feeCurrency, {wallet: this})
const [numerator, denominator] = await getConversionRateFromCeloToToken(feeCurrency, this)
const feeDenominatedInToken = convertFromCeloToToken({
amountInCelo: maxGasFeesInCELO,
ratioTOKEN: numerator,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/CoreContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ const MINIMAL_REGISTRY_ABI = [{



export async function getConversionRateFromCeloToToken(tokenAddress: string, {wallet}: {wallet: CeloWallet}): Promise<[bigint, bigint]> {
const registry = new Contract(CELO_REGISTRY_ADDRESS, MINIMAL_REGISTRY_ABI , wallet)
export async function getConversionRateFromCeloToToken(tokenAddress: string, wallet: CeloWallet): Promise<[bigint, bigint]> {
const registry = new Contract(CELO_REGISTRY_ADDRESS, MINIMAL_REGISTRY_ABI, wallet)

const oracleAddress = await registry.getAddressForString('SortedOracles')

Expand Down
6 changes: 2 additions & 4 deletions tests/CeloWallet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ describe('CeloWallet', () => {
test('populates only maxFeePerGas and maxPriorityFeePerGas', async () => {
const wallet = getSigner()

const transactionRequest: CeloTransactionRequest = {

}
const transactionRequest: CeloTransactionRequest = {}

const filled = await wallet.populateFees(transactionRequest)

Expand Down Expand Up @@ -50,7 +48,7 @@ describe('CeloWallet', () => {
})
describe('when feeCurrency before cel2', () => {
test('populates maxFeePerGas and maxPriorityFeePerGas and maxFeeInFeeCurrency', async () => {
const wallet = getSigner()
const wallet = getSigner()


jest.spyOn(wallet, 'isCel2').mockImplementation(async () => false)
Expand Down

0 comments on commit f2be773

Please sign in to comment.