Skip to content

Commit

Permalink
Move swap calculate to manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jorbuedo committed Oct 15, 2024
1 parent 0432939 commit f7549e5
Show file tree
Hide file tree
Showing 16 changed files with 235 additions and 145 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {storiesOf} from '@storybook/react-native'
import {tokenInfoMocks} from '@yoroi/portfolio'
import {mockSwapManager, mockSwapStateDefault, orderMocks, SwapOrderCalculation, SwapProvider} from '@yoroi/swap'
import {mockSwapManager, mockSwapStateDefault, orderMocks, SwapProvider} from '@yoroi/swap'
import {Swap} from '@yoroi/types'
import React from 'react'
import {StyleSheet, View} from 'react-native'

Expand Down Expand Up @@ -33,7 +34,7 @@ storiesOf('TransactionSummary', module) //
)
})

const TxSummary = ({calculation}: {calculation: SwapOrderCalculation}) => {
const TxSummary = ({calculation}: {calculation: Swap.OrderCalculation}) => {
return (
<WalletManagerProviderMock wallet={{...walletMocks.wallet}}>
<SwapProvider
Expand Down
2 changes: 1 addition & 1 deletion apps/wallet-mobile/src/kernel/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ export const governaceAfterBlock = freeze({

export const agreementDate = 1691967600000

export const loggerLevel: App.Logger.Level = isDev ? App.Logger.Level.Debug : App.Logger.Level.Warn
export const loggerLevel: App.Logger.Level = isDev ? App.Logger.Level.Log : App.Logger.Level.Warn
5 changes: 2 additions & 3 deletions packages/swap/src/helpers/mocks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Swap} from '@yoroi/types'

import {SwapOrderCalculation} from '../types'
import {tokenInfoMocks} from '../tokenInfo.mocks'

const mockedPools1: Swap.Pool[] = [
Expand Down Expand Up @@ -600,7 +599,7 @@ const mockedPools8: Swap.Pool[] = [
},
]

const mockedOrderCalculations1: SwapOrderCalculation[] = [
const mockedOrderCalculations1: Swap.OrderCalculation[] = [
{
order: {
side: 'sell',
Expand Down Expand Up @@ -1197,7 +1196,7 @@ const mockedOrderCalculations1: SwapOrderCalculation[] = [
},
]

const mockedOrderCalculations2: SwapOrderCalculation[] = [
const mockedOrderCalculations2: Swap.OrderCalculation[] = [
{
order: {
side: 'buy',
Expand Down
Loading

0 comments on commit f7549e5

Please sign in to comment.