Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong setup/expectation in TRANS_CREATE_03 #2299

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

Anviking
Copy link
Member

@Anviking Anviking commented Nov 5, 2020

Issue Number

#2298

Overview

  • Make wDest start empty, instead of with amt balance, such that the expectation makes sense.
  • Haven't run this yet though. Fixed.

Comments

It used to create a wDest wallet with amt balance, sent another amt to
it, and expect the balance to be amt. Somewhat astounding that this
didn't fail more often.

src/Test/Integration/Scenario/API/Shelley/Transactions.hs:435:26:
      1) API Specifications, SHELLEY_TRANSACTIONS, TRANS_CREATE_03 - 0 balance after transaction
           While verifying (Status {statusCode = 200, statusMessage = "OK"},Right (ApiWallet {id = ApiT {getApiT = WalletId {getWalletId = 278f9ebf2dcf1cb23e1af27281daed107333fd16}}, addressPoolGap = ApiT {getApiT = AddressPoolGap {getAddressPoolGap = 20}}, balance = ApiT {getApiT = WalletBalance {available = Quantity {getQuantity = 2000000}, total = Quantity {getQuantity = 2000000}, reward = Quantity {getQuantity = 0}}}, delegation = ApiWalletDelegation {active = ApiWalletDelegationNext {status = NotDelegating, target = Nothing, changesAt = Nothing}, next = []}, name = ApiT {getApiT = WalletName {getWalletName = "Empty Wallet"}}, passphrase = Just (ApiWalletPassphraseInfo {lastUpdatedAt = 2020-11-04 18:51:44.994771905 UTC}), state = ApiT {getApiT = Ready}, tip = ApiBlockReference {absoluteSlotNumber = ApiT {getApiT = SlotNo 2113}, slotId = ApiSlotId {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 11}}, slotNumber = ApiT {getApiT = SlotInEpoch {unSlotInEpoch = 33}}}, time = 2020-11-04 18:53:51.6 UTC, block = ApiBlockInfo {height = Quantity {getQuantity = 946}}}}))
           Waited longer than 90s to resolve action: "Wallet balance is as expected".
           expected: Quantity {getQuantity = 1000000}
            but got: Quantity {getQuantity = 2000000}
      To rerun use: --match "/API Specifications/SHELLEY_TRANSACTIONS/TRANS_CREATE_03 - 0 balance after transaction/"

Two possible fixes:
1. Make the wDest start with 0 balance
2. Expect wDest to have 2*amt

1 makes more sense in a way, but we actually rely on wDest having amt
balance to predict the fees, /before/ creating wSrc. So 2 is easer in
this case.

@Anviking Anviking requested a review from piotr-iohk November 5, 2020 11:56
@Anviking Anviking self-assigned this Nov 5, 2020
@Anviking Anviking marked this pull request as draft November 5, 2020 12:00
It used to create a wDest wallet with amt balance, sent another amt to
it, and expect the balance to be amt. Somewhat astounding that this
didn't fail more often.

src/Test/Integration/Scenario/API/Shelley/Transactions.hs:435:26:
      1) API Specifications, SHELLEY_TRANSACTIONS, TRANS_CREATE_03 - 0 balance after transaction
           While verifying (Status {statusCode = 200, statusMessage = "OK"},Right (ApiWallet {id = ApiT {getApiT = WalletId {getWalletId = 278f9ebf2dcf1cb23e1af27281daed107333fd16}}, addressPoolGap = ApiT {getApiT = AddressPoolGap {getAddressPoolGap = 20}}, balance = ApiT {getApiT = WalletBalance {available = Quantity {getQuantity = 2000000}, total = Quantity {getQuantity = 2000000}, reward = Quantity {getQuantity = 0}}}, delegation = ApiWalletDelegation {active = ApiWalletDelegationNext {status = NotDelegating, target = Nothing, changesAt = Nothing}, next = []}, name = ApiT {getApiT = WalletName {getWalletName = "Empty Wallet"}}, passphrase = Just (ApiWalletPassphraseInfo {lastUpdatedAt = 2020-11-04 18:51:44.994771905 UTC}), state = ApiT {getApiT = Ready}, tip = ApiBlockReference {absoluteSlotNumber = ApiT {getApiT = SlotNo 2113}, slotId = ApiSlotId {epochNumber = ApiT {getApiT = EpochNo {unEpochNo = 11}}, slotNumber = ApiT {getApiT = SlotInEpoch {unSlotInEpoch = 33}}}, time = 2020-11-04 18:53:51.6 UTC, block = ApiBlockInfo {height = Quantity {getQuantity = 946}}}}))
           Waited longer than 90s to resolve action: "Wallet balance is as expected".
           expected: Quantity {getQuantity = 1000000}
            but got: Quantity {getQuantity = 2000000}
      To rerun use: --match "/API Specifications/SHELLEY_TRANSACTIONS/TRANS_CREATE_03 - 0 balance after transaction/"

Two possible fixes:
1. Make the wDest start with 0 balance
2. Expect wDest to have 2*amt

1 makes more sense in a way, but we actually rely on wDest having amt
balance to predict the fees, /before/ creating wSrc. So 2 is easer in
this case.
@Anviking Anviking force-pushed the anviking/2298/use-empty branch from f2e78a2 to f18b849 Compare November 5, 2020 12:08
@Anviking Anviking marked this pull request as ready for review November 5, 2020 12:11
@Anviking
Copy link
Member Author

Anviking commented Nov 5, 2020

Seems the first method didn't work since wDest starting with amt was needed to estimate fees. Changed to expect 2*amt instead.

Copy link
Contributor

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx!

@Anviking
Copy link
Member Author

Anviking commented Nov 5, 2020

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Nov 5, 2020

Build succeeded:

@iohk-bors iohk-bors bot merged commit 8a85b7a into master Nov 5, 2020
@iohk-bors iohk-bors bot deleted the anviking/2298/use-empty branch November 5, 2020 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants