1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Revert "remove previous orders from price calculation in compute"

This reverts commit 504840a2d3.
This commit is contained in:
EnzoVezzaro 2022-10-19 09:06:34 -04:00
parent 504840a2d3
commit 5819c25015
2 changed files with 11 additions and 1 deletions

View File

@ -196,7 +196,9 @@ export default function FormStartCompute({
hasPreviousOrderSelectedComputeAsset={ hasPreviousOrderSelectedComputeAsset={
hasPreviousOrderSelectedComputeAsset hasPreviousOrderSelectedComputeAsset
} }
hasDatatoken={hasDatatoken}
selectedComputeAssetTimeout={selectedComputeAssetTimeout} selectedComputeAssetTimeout={selectedComputeAssetTimeout}
hasDatatokenSelectedComputeAsset={hasDatatokenSelectedComputeAsset}
algorithmConsumeDetails={selectedAlgorithmAsset?.accessDetails} algorithmConsumeDetails={selectedAlgorithmAsset?.accessDetails}
symbol={oceanSymbol} symbol={oceanSymbol}
totalPrice={totalPrice} totalPrice={totalPrice}

View File

@ -9,9 +9,11 @@ import Decimal from 'decimal.js'
interface PriceOutputProps { interface PriceOutputProps {
totalPrice: string totalPrice: string
hasPreviousOrder: boolean hasPreviousOrder: boolean
hasDatatoken: boolean
symbol: string symbol: string
assetTimeout: string assetTimeout: string
hasPreviousOrderSelectedComputeAsset: boolean hasPreviousOrderSelectedComputeAsset: boolean
hasDatatokenSelectedComputeAsset: boolean
algorithmConsumeDetails: AccessDetails algorithmConsumeDetails: AccessDetails
selectedComputeAssetTimeout: string selectedComputeAssetTimeout: string
datasetOrderPrice?: string datasetOrderPrice?: string
@ -23,6 +25,7 @@ interface PriceOutputProps {
function Row({ function Row({
price, price,
hasPreviousOrder, hasPreviousOrder,
hasDatatoken,
symbol, symbol,
timeout, timeout,
sign, sign,
@ -30,6 +33,7 @@ function Row({
}: { }: {
price: string price: string
hasPreviousOrder?: boolean hasPreviousOrder?: boolean
hasDatatoken?: boolean
symbol?: string symbol?: string
timeout?: string timeout?: string
sign?: string sign?: string
@ -41,7 +45,7 @@ function Row({
<div className={styles.type}>{type}</div> <div className={styles.type}>{type}</div>
<div> <div>
<PriceUnit <PriceUnit
price={Number(price)} price={hasPreviousOrder || hasDatatoken ? 0 : Number(price)}
symbol={symbol} symbol={symbol}
size="small" size="small"
className={styles.price} className={styles.price}
@ -60,9 +64,11 @@ function Row({
export default function PriceOutput({ export default function PriceOutput({
totalPrice, totalPrice,
hasPreviousOrder, hasPreviousOrder,
hasDatatoken,
assetTimeout, assetTimeout,
symbol, symbol,
hasPreviousOrderSelectedComputeAsset, hasPreviousOrderSelectedComputeAsset,
hasDatatokenSelectedComputeAsset,
algorithmConsumeDetails, algorithmConsumeDetails,
selectedComputeAssetTimeout, selectedComputeAssetTimeout,
datasetOrderPrice, datasetOrderPrice,
@ -81,6 +87,7 @@ export default function PriceOutput({
<div className={styles.calculation}> <div className={styles.calculation}>
<Row <Row
hasPreviousOrder={hasPreviousOrder} hasPreviousOrder={hasPreviousOrder}
hasDatatoken={hasDatatoken}
price={new Decimal( price={new Decimal(
datasetOrderPrice || asset?.accessDetails?.price || 0 datasetOrderPrice || asset?.accessDetails?.price || 0
) )
@ -92,6 +99,7 @@ export default function PriceOutput({
/> />
<Row <Row
hasPreviousOrder={hasPreviousOrderSelectedComputeAsset} hasPreviousOrder={hasPreviousOrderSelectedComputeAsset}
hasDatatoken={hasDatatokenSelectedComputeAsset}
price={new Decimal( price={new Decimal(
algoOrderPrice || algorithmConsumeDetails?.price || 0 algoOrderPrice || algorithmConsumeDetails?.price || 0
) )