Skip to content

Commit

Permalink
fix(lunc-force-epoch-fee-calc): (#393)
Browse files Browse the repository at this point in the history
added fee calc
  • Loading branch information
worrex authored Oct 1, 2023
1 parent 9fb0611 commit 9337158
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useQueryIncentiveContracts } from 'components/Pages/Trade/Incentivize/h
import { useClients } from 'hooks/useClients'
import useTxStatus from 'hooks/useTxStatus'
import { useRecoilValue } from 'recoil'
import { TerraTreasuryService } from 'services/treasuryService'
import { chainState } from 'state/chainState'
import { createExecuteMessage } from 'util/messages/index'

Expand Down Expand Up @@ -77,9 +78,20 @@ const useForceEpochAndTakingSnapshots = ({
}, [addresses, address])

const { mutate: submit, ...state } = useMutation({
mutationFn: () => signingClient.signAndBroadcast(
address, msgs, 'auto', null,
),
mutationFn: async () => {
let fee: any = 'auto'
if (await signingClient.getChainId() === 'columbus-5') {
const gas = Math.ceil(await signingClient.simulate(
address, msgs, '',
) * 1.3)
fee = await TerraTreasuryService.getInstance().getTerraClassicFee(
0, '', gas,
)
}
return await signingClient.signAndBroadcast(
address, msgs, fee, null,
)
},
onError,
onSuccess,
})
Expand Down

0 comments on commit 9337158

Please sign in to comment.