Skip to content

Commit

Permalink
Delete TRANSMETA_ESTIMATE_01a and TRANSMETA_ESTIMATE_01b.
Browse files Browse the repository at this point in the history
The integration test suite is arguably the wrong place to test that fee
estimates should increase or decrease if the outputs of a transaction
are changed.

Moreover, depending on the initial starting conditions and the random
selection performed for each round of fee estimation, it's not
guaranteed that if the outputs for transaction `a` are smaller than the
outputs for transaction `b`, then the fee estimate for transaction `a`
will be lower than the fee estimate for transaction `b`.
  • Loading branch information
jonathanknowles committed Apr 5, 2023
1 parent 65cd7a3 commit fd5deb9
Showing 1 changed file with 0 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1114,78 +1114,6 @@ spec = describe "SHELLEY_TRANSACTIONS" $ do
expectResponseCode HTTP.status403 r
expectErrorMessage errMsg403TxTooBig r

it "TRANSMETA_ESTIMATE_01a - \
\fee estimation includes metadata" $
\ctx -> runResourceT $ do

(wa, wb) <- (,) <$> fixtureWallet ctx <*> emptyWallet ctx
let amt = minUTxOValue (_mainEra ctx) :: Natural

payload <- mkTxPayload ctx wb amt fixturePassphrase

let txMeta = [json|{ "1": { "string": "hello" } }|]
let payloadWithMetadata = addTxMetadata txMeta payload

ra <- request @ApiFee ctx
(Link.getTransactionFeeOld @'Shelley wa) Default payloadWithMetadata
verify ra
[ expectSuccess
, expectResponseCode HTTP.status202
]
let (Quantity feeEstMin) = getFromResponse #estimatedMin ra
let (Quantity feeEstMax) = getFromResponse #estimatedMax ra

-- check that it's estimated to have less fees for transactions without
-- metadata.
rb <- request @ApiFee ctx
(Link.getTransactionFeeOld @'Shelley wa) Default payload
verify rb
[ expectResponseCode HTTP.status202
, expectField (#estimatedMin . #getQuantity) (.< feeEstMin)
, expectField (#estimatedMax . #getQuantity) (.< feeEstMax)
]

it "TRANSMETA_ESTIMATE_01b - \
\fee estimation includes no-schema metadata" $
\ctx -> runResourceT $ do

(wa, wb) <- (,) <$> fixtureWallet ctx <*> emptyWallet ctx
let amt = minUTxOValue (_mainEra ctx) :: Natural

payload <- mkTxPayload ctx wb amt fixturePassphrase

let txMeta = [json|{ "1": "hello" }|]
let payloadWithMetadata = addTxMetadata txMeta payload

ra <-
request @ApiFee
ctx
(Link.getTransactionFeeOld @'Shelley wa)
Default
payloadWithMetadata
verify
ra
[ expectSuccess
, expectResponseCode HTTP.status202
]
let (Quantity feeEstMin) = getFromResponse #estimatedMin ra
let (Quantity feeEstMax) = getFromResponse #estimatedMax ra

-- check that it's estimated to have less fees for transactions without
-- metadata.
rb <-
request @ApiFee
ctx
(Link.getTransactionFeeOld @'Shelley wa)
Default
payload
verify
rb
[ expectResponseCode HTTP.status202
, expectField (#estimatedMin . #getQuantity) (.< feeEstMin)
, expectField (#estimatedMax . #getQuantity) (.< feeEstMax)
]

it "TRANSMETA_ESTIMATE_02a - \
\fee estimation with invalid metadata" $
\ctx -> runResourceT $ do
Expand Down

0 comments on commit fd5deb9

Please sign in to comment.