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

Seath first steps continue #17

Merged
merged 7 commits into from Mar 14, 2023

Conversation

mikekeke
Copy link
Collaborator

@mikekeke mikekeke commented Mar 9, 2023

Added:

  • basic final state check for example runner
  • some helper functions

Modified:

  • removed waiting for transaction confirmation during chain of transactions submission
  • before check final state execution waits till last TX in chain will be confirmed
  • initialization separated from Seath execution

@mikekeke mikekeke changed the base branch from development to Luis-omega/seath-first-steps March 9, 2023 12:37
@mikekeke mikekeke requested a review from Luis-omega March 9, 2023 12:50
-  `action2Transaction...` functions merged into one
Copy link
Collaborator

@Luis-omega Luis-omega left a comment

Choose a reason for hiding this comment

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

Pending to complete

-- logInfo' $ "submited: " <> show transactionId
pure $ transactionId

newtype BlockhainState = BlockhainState
{ leaderUTXOs :: Maybe UtxoMap
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is it a maybe? if can't get the map we can use a empty map here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, didn't think about that. I just used the same type that getWalletUtxos from CTL returns, but not sure atm what is the case for Notning there.

Copy link
Collaborator

Choose a reason for hiding this comment

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

for getWalletUxos make sense since is different not having any UTxO than failing to query it. In this case we control if there are UTxOs in the leader, if we can't get them, we did something wrong.

-- logInfo' $ "submited: " <> show transactionId
pure $ transactionId

newtype BlockhainState = BlockhainState
{ leaderUTXOs :: Maybe UtxoMap
, usersUTXOs :: Array (Maybe UtxoMap)
Copy link
Collaborator

Choose a reason for hiding this comment

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

same as with the leader

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also I'm still of the opinion to put optionally names to the users or at least fix their index in the array to have a short reference while debugging (it was incredible useful to debug why seath was failing)

off-chain/test/Examples/Addition/Contract.purs Outdated Show resolved Hide resolved
off-chain/test/Examples/Addition/ContractSeath.purs Outdated Show resolved Hide resolved
checkScriptState bchState

where
checlLeaderUtxos bchState = do
Copy link
Collaborator

Choose a reason for hiding this comment

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

we also need a check that we aren't changing the leader utxos.

In the future when we add the fee for the leader, this would be broken, but as the fee mechanism is not clear right now, having this test is good for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we can make something more general like assertState where we can pass predicates and check intermediate states also.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes, we definitely want something like that and also integrate the tests using mote.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made separate issue for this - #20

off-chain/test/Examples/Utils.purs Outdated Show resolved Hide resolved
@Luis-omega Luis-omega merged commit a03701d into Luis-omega/seath-first-steps Mar 14, 2023
@Luis-omega Luis-omega deleted the seath-first-steps-continue branch March 14, 2023 04:30
@mikekeke mikekeke mentioned this pull request Mar 14, 2023
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.

None yet

2 participants