Skip to content

Commit

Permalink
Fixed ticket price calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
victoriari committed Jun 5, 2024
1 parent 5526140 commit 92af560
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions client/src/app/scenes/play-modal/ModalState.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { csprToMotes } from 'casper-js-sdk';
import Big from 'big.js';
import {
BuyTicketContent,
DeployFailedContent,
Expand All @@ -14,6 +14,7 @@ import {
import { DeployFailed } from '../../services/requests/play-requests';
import useManagePlay from '../../services/hooks/use-manage-play';
import { Play } from '../../types';
import { csprToMotes } from 'casper-js-sdk';

interface PlayResultStateProps {
playResult: Play | DeployFailed;
Expand Down Expand Up @@ -84,9 +85,9 @@ const ModalState = (props: ModalStateProps) => {
window.open('https://testnet.cspr.live/tools/faucet', '_blank');
};

const ticketPrice =
config.gas_price_in_cspr + config.lottery_ticket_price_in_cspr;

const ticketPrice = Big(config.gas_price_in_cspr)
.add(config.lottery_ticket_price_in_cspr)
.toNumber();
const isNotEnoughBalance =
!!activeAccountWithBalance &&
(activeAccountWithBalance.balance == null ||
Expand Down

0 comments on commit 92af560

Please sign in to comment.