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

Factor out guards into helpers in balanceTransaction #3092

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

Anviking
Copy link
Member

  • Factor out guards in balanceTransaction into helpers for readability

Comments

Preparation for other work.

Issue Number

ADP-1372

@Anviking Anviking self-assigned this Jan 21, 2022
-- Coin selection does not support pre-defining collateral. In Sep 2021
-- consensus was that we /could/ allow for it with just a day's work or so,
-- but that the need for it was unclear enough that it was not in any way
-- a priority.
Copy link
Member

Choose a reason for hiding this comment

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

I might be wrong, but suspect it would not just be "a day's work" 😄 .

Copy link
Member Author

Choose a reason for hiding this comment

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

😄 I thought that was what you said

@Anviking
Copy link
Member Author

Thanks!
bors r+

iohk-bors bot added a commit that referenced this pull request Jan 27, 2022
3092: Factor out guards into helpers in balanceTransaction r=Anviking a=Anviking

- [x] Factor out guards in balanceTransaction into helpers for readability

### Comments

Preparation for other work.

### Issue Number

ADP-1372


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 27, 2022

Build failed:

Failures:

  src/Test/Integration/Framework/DSL.hs:1079:11:
  1) API Specifications, SHELLEY_STAKE_POOLS, STAKE_POOLS_JOIN_01rewards - Can join a pool, earn rewards and collect them
       Quantity 0 does not satisfy (> Quantity 0)
       While verifying value:
         ( Status
             { statusCode = 200
             , statusMessage = "OK"
             }
         , Right
             ( ApiWallet
                 { id = ApiT
                     ( WalletId
                         { getWalletId = 08 a5be01a57642239a3c7bd27799c555fd297358 }
                     )
                 , addressPoolGap = ApiT
                     ( AddressPoolGap
                         { getAddressPoolGap = 20 }
                     )
                 , balance = ApiWalletBalance
                     { available = Quantity 999998854600
                     , total = Quantity 999998854600
                     , reward = Quantity 0
                     }
                 , assets = ApiWalletAssetsBalance
                     { available = ApiT
                         ( TokenMap
                             ( fromList [] )
                         )
                     , total = ApiT
                         ( TokenMap
                             ( fromList [] )
                         )
                     }
                 , delegation = ApiWalletDelegation
                     { active = ApiWalletDelegationNext
                         { status = Delegating
                         , target = Just
                             ( ApiT
                                 ( PoolId
                                     { getPoolId = "ì(ó=ËæÖ@
                                     \x1e^3\x9bÐd|\x9sÊl\xcù»æ\x83\x8dÆ" }
                                 )
                             )
                         , changesAt = Nothing
                         }
                     , next = []
                     }
                 , name = ApiT
                     ( WalletName
                         { getWalletName = "Faucet Wallet" }
                     )
                 , passphrase = Just
                     ( ApiWalletPassphraseInfo 2022 - 01 - 27 10 : 54 : 31.439025 UTC )
                 , state = ApiT Ready
                 , tip = ApiBlockReference
                     { absoluteSlotNumber = ApiT
                         ( SlotNo 3848 )
                     , slotId = ApiSlotId
                         { epochNumber = ApiT
                             ( EpochNo
                                 { unEpochNo = 38 }
                             )
                         , slotNumber = ApiT
                             ( SlotInEpoch
                                 { unSlotInEpoch = 48 }
                             )
                         }
                     , time = 2022 - 01 - 27 10 : 56 : 41.6 UTC
                     , block = ApiBlockInfo
                         ( Quantity 1728 )
                     }
                 }
             )
         )

       Waited longer than 90s to resolve action: "Wallet gets rewards".

  To rerun use: --match "/API Specifications/SHELLEY_STAKE_POOLS/STAKE_POOLS_JOIN_01rewards - Can join a pool, earn rewards and collect them/"

  src/Test/Integration/Framework/DSL.hs:1079:11:
  2) API Specifications, SHELLEY_STAKE_POOLS, STAKE_POOLS_JOIN_04 - Rewards accumulate
       Quantity 0 does not satisfy (> Quantity 0)
       While verifying value:
         ( Status
             { statusCode = 200
             , statusMessage = "OK"
             }
         , Right
             ( ApiWallet
                 { id = ApiT
                     ( WalletId { getWalletId = dca0d19c766a50575f25a326605f11eb9da36d6a } )
                 , addressPoolGap = ApiT
                     ( AddressPoolGap
                         { getAddressPoolGap = 20 }
                     )
                 , balance = ApiWalletBalance
                     { available = Quantity 999998854600
                     , total = Quantity 999998854600
                     , reward = Quantity 0
                     }
                 , assets = ApiWalletAssetsBalance
                     { available = ApiT
                         ( TokenMap
                             ( fromList [] )
                         )
                     , total = ApiT
                         ( TokenMap
                             ( fromList [] )
                         )
                     }
                 , delegation = ApiWalletDelegation
                     { active = ApiWalletDelegationNext
                         { status = Delegating
                         , target = Just
                             ( ApiT
                                 ( PoolId
                                     { getPoolId = "ì(ó=ËæÖ@
                                     \x1e^3\x9bÐd|\x9sÊl\xcù»æ\x83\x8dÆ" }
                                 )
                             )
                         , changesAt = Nothing
                         }
                     , next = []
                     }
                 , name = ApiT
                     ( WalletName
                         { getWalletName = "Faucet Wallet" }
                     )
                 , passphrase = Just
                     ( ApiWalletPassphraseInfo 2022 - 01 - 27 10 : 56 : 12.549946 UTC )
                 , state = ApiT Ready
                 , tip = ApiBlockReference
                     { absoluteSlotNumber = ApiT
                         ( SlotNo 4348 )
                     , slotId = ApiSlotId
                         { epochNumber = ApiT
                             ( EpochNo
                                 { unEpochNo = 43 }
                             )
                         , slotNumber = ApiT
                             ( SlotInEpoch
                                 { unSlotInEpoch = 48 }
                             )
                         }
                     , time = 2022 - 01 - 27 10 : 58 : 21.6 UTC
                     , block = ApiBlockInfo
                         ( Quantity 1988 )
                     }
                 }
             )
         )

       Waited longer than 90s to resolve action: "Wallet gets rewards".

  To rerun use: --match "/API Specifications/SHELLEY_STAKE_POOLS/STAKE_POOLS_JOIN_04 - Rewards accumulate/"

  src/Test/Integration/Framework/DSL.hs:1079:11:
  3) API Specifications, SHELLEY_STAKE_POOLS, STAKE_POOLS_LIST_01 - List stake pools, has non-zero saturation & stake
       Quantity (Percentage (0 % 1)) does not satisfy (> Quantity (Percentage (0 % 1)))
       While verifying value:
         ( Status
             { statusCode = 200
             , statusMessage = "OK"
             }
         , Right
             [ ApiStakePool
                 { id = ApiT
                     ( PoolId
                         { getPoolId = "ì(ó=ËæÖ@
                         \x1e^3\x9bÐd|\x9sÊl\xcù»æ\x83\x8dÆ" }
                     )
                 , metrics = ApiStakePoolMetrics
                     { nonMyopicMemberRewards = Quantity 332039273903558
                     , relativeStake = Quantity
                         ( Percentage
                             ( 1 % 10000 )
                         )
                     , saturation = 1.6489070927498852 e- 4
                     , producedBlocks = Quantity 129
                     }
                 , metadata = Nothing
                 , cost = Quantity 0
                 , margin = Quantity
                     ( Percentage
                         ( 1 % 10 )
                     )
                 , pledge = Quantity 2000000000000
                 , retirement = Nothing
                 , flags = []
                 }
             , ApiStakePool
                 { id = ApiT
                     ( PoolId
                         { getPoolId = "»\x11L³}uú\x5&\x3(Â5£Úâ\x95£=\xb¦t¥ë\x1e>V\x8e" }
                     )
                 , metrics = ApiStakePoolMetrics
                     { nonMyopicMemberRewards = Quantity 332039146112728
                     , relativeStake = Quantity
                         ( Percentage
                             ( 0 % 1 )
                         )
                     , saturation = 6.790261334336803 e- 5
                     , producedBlocks = Quantity 65
                     }
                 , metadata = Nothing
                 , cost = Quantity 0
                 , margin = Quantity
                     ( Percentage
                         ( 1 % 10 )
                     )
                 , pledge = Quantity 1000000000000
                 , retirement = Just
                     ( ApiEpochInfo
                         { epochNumber = ApiT
                             ( EpochNo
                                 { unEpochNo = 1000000 }
                             )
                         , epochStartTime = 2022 - 09 - 15 22 : 17 : 12 UTC
                         }
                     )
                 , flags = []
                 }
             , ApiStakePool
                 { id = ApiT
                     ( PoolId
                         { getPoolId = "´WhÁ¢ÚKÑ>¼ª\x1e¥\x14\x8í£\x1dÌ!v\ËÔ\x7Í©ò" }
                     )
                 , metrics = ApiStakePoolMetrics
                     { nonMyopicMemberRewards = Quantity 143535959691936
                     , relativeStake = Quantity
                         ( Percentage
                             ( 4227 % 5000 )
                         )
                     , saturation = 2.5361830608857567
                     , producedBlocks = Quantity 1714
                     }
                 , metadata = Nothing
                 , cost = Quantity 0
                 , margin = Quantity
                     ( Percentage
                         ( 1 % 10 )
                     )
                 , pledge = Quantity 1000000000000
                 , retirement = Just
                     ( ApiEpochInfo
                         { epochNumber = ApiT
                             ( EpochNo
                                 { unEpochNo = 100000 }
                             )
                         , epochStartTime = 2022 - 02 - 19 14 : 17 : 12 UTC
                         }
                     )
                 , flags = []
                 }
             ]
         )

       Waited longer than 90s to resolve action: "list pools returns non-empty list".

  To rerun use: --match "/API Specifications/SHELLEY_STAKE_POOLS/STAKE_POOLS_LIST_01 - List stake pools/has non-zero saturation & stake/"

Randomized with seed 9888692

Finished in 1388.2676 seconds, used 429.8120 seconds of CPU time
896 examples, 3 failures, 48 pending

#3123 - only three failures, but could be related

@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 27, 2022
3092: Factor out guards into helpers in balanceTransaction r=Anviking a=Anviking

- [x] Factor out guards in balanceTransaction into helpers for readability

### Comments

Preparation for other work.

### Issue Number

ADP-1372


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 27, 2022

Build failed:

Hydra unit timeout on linux (not mac where we had problems in the past). Last logs:

    signTransaction adds extra key witness when necessary (AnyCardanoEra MaryEra)
      +++ OK, passed 100 tests (100% feature not supported in MaryEra.).
    signTransaction adds extra key witness when necessary (AnyCardanoEra AlonzoEra) (74793ms)
      +++ OK, passed 100 tests.
    signTransaction adds tx in witnesses when necessary (AnyCardanoEra ByronEra) (1ms)
      +++ OK, passed 100 tests.

#2472

@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 27, 2022
3092: Factor out guards into helpers in balanceTransaction r=Anviking a=Anviking

- [x] Factor out guards in balanceTransaction into helpers for readability

### Comments

Preparation for other work.

### Issue Number

ADP-1372


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 27, 2022

Build failed:

Finished in 2405.1621 seconds, used 1880.0654 seconds of CPU time
4280 examples, 0 failures, 43 pending

Apparently a Mac unit test timeout after the tests completed.

#2472

@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 27, 2022
3092: Factor out guards into helpers in balanceTransaction r=Anviking a=Anviking

- [x] Factor out guards in balanceTransaction into helpers for readability

### Comments

Preparation for other work.

### Issue Number

ADP-1372


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 27, 2022

Build failed:

  src/Test/Integration/Scenario/API/Shelley/StakePools.hs:524:5: 
  1) API Specifications, SHELLEY_STAKE_POOLS, STAKE_POOLS_JOIN_01 - Can rejoin another stakepool
       uncaught exception: IOException of type UserError
       user error (next delegation should contain exactly one element)

  To rerun use: --match "/API Specifications/SHELLEY_STAKE_POOLS/STAKE_POOLS_JOIN_01 - Can rejoin another stakepool/"

Randomized with seed 136491391

@Anviking
Copy link
Member Author

bors r+

iohk-bors bot added a commit that referenced this pull request Jan 27, 2022
3092: Factor out guards into helpers in balanceTransaction r=Anviking a=Anviking

- [x] Factor out guards in balanceTransaction into helpers for readability

### Comments

Preparation for other work.

### Issue Number

ADP-1372


Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 27, 2022

Build failed:

src/Test/Integration/Framework/DSL.hs:1079:11:
  1) API Specifications, SHELLEY_STAKE_POOLS, STAKE_POOLS_JOIN_01rewards - Can join a pool, earn rewards and collect them
       Quantity 0 does not satisfy (> Quantity 0)
       While verifying value:
         ( Status
             { statusCode = 200
             , statusMessage = "OK"
             }
         , Right
             ( ApiWallet
                 { id = ApiT
                     ( WalletId
                         { getWalletId = 08 a5be01a57642239a3c7bd27799c555fd297358 }
                     )
                 , addressPoolGap = ApiT
                     ( AddressPoolGap
                         { getAddressPoolGap = 20 }
                     )
                 , balance = ApiWalletBalance
                     { available = Quantity 999998854600
                     , total = Quantity 999998854600
                     , reward = Quantity 0
                     }
                 , assets = ApiWalletAssetsBalance
                     { available = ApiT
                         ( TokenMap
                             ( fromList [] )
                         )
                     , total = ApiT
                         ( TokenMap
                             ( fromList [] )
                         )
                     }
                 , delegation = ApiWalletDelegation
                     { active = ApiWalletDelegationNext
                         { status = Delegating
                         , target = Just
                             ( ApiT
                                 ( PoolId
                                     { getPoolId = "ì(ó=ËæÖ@
                                     \x1e^3\x9bÐd|\x9sÊl\xcù»æ\x83\x8dÆ" }
                                 )
                             )
                         , changesAt = Nothing
                         }
                     , next = []
                     }
                 , name = ApiT
                     ( WalletName
                         { getWalletName = "Faucet Wallet" }
                     )
                 , passphrase = Just
                     ( ApiWalletPassphraseInfo 2022 - 01 - 27 19 : 40 : 49.004227 UTC )
                 , state = ApiT
                     ( Syncing
                         ( Quantity
                             ( Percentage
                                 ( 9279 % 10000 )
                             )
                         )
                     )
                 , tip = ApiBlockReference
                     { absoluteSlotNumber = ApiT
                         ( SlotNo 3585 )
                     , slotId = ApiSlotId
                         { epochNumber = ApiT
                             ( EpochNo
                                 { unEpochNo = 35 }
                             )
                         , slotNumber = ApiT
                             ( SlotInEpoch
                                 { unSlotInEpoch = 85 }
                             )
                         }
                     , time = 2022 - 01 - 27 19 : 41 : 56 UTC
                     , block = ApiBlockInfo
                         ( Quantity 1572 )
                     }
                 }
             )
         )

       Waited longer than 90s to resolve action: "Wallet gets rewards".

A lot of stake pool related tests were failing, indicating something ended up wrong with the setup of one pool (have not looked close)

#3123

@Anviking
Copy link
Member Author

Bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Jan 27, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit 47f1d23 into master Jan 27, 2022
@iohk-bors iohk-bors bot deleted the anviking/ADP-1372/factor-guards branch January 27, 2022 22:39
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