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

added passage of time in the local pact server #1082

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

qooboodoop
Copy link
Contributor

The current pact -s local server does not proceed block-time as well as block-height and prev-block-hash, but I didn't change the last two as I am not sure when a block mine is supposed to happen. This sets the block-time at the current UTC time which makes the (chain-data) a little bit more interesting than being stuck on 0 of epoch.

jwiegley
jwiegley previously approved these changes Dec 9, 2022
@@ -94,14 +95,15 @@ applyCmd _ _ _ _ _ _ _ _ _ _ cmd (ProcFail s) =
Nothing
(cmdToRequestKey cmd)
(PactError TxFailure def def . viaShow $ s)
applyCmd logger conf dbv gasModel bh bt pbh spv exConfig exMode _ (ProcSucc cmd) = do
applyCmd logger conf dbv gasModel bh _ pbh spv exConfig exMode _ (ProcSucc cmd) = do
blocktime <- (((*) 1000000) <$> systemSeconds <$> getSystemTime)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
blocktime <- (((*) 1000000) <$> systemSeconds <$> getSystemTime)
blocktime <- (*) 1_000_000 . systemSeconds <$> getSystemTime

This needs to be paired with {-# LANGUAGE NumericUnderscores #-} up top.

@jwiegley jwiegley dismissed their stale review December 9, 2022 01:03

I'd like to try this out on command-line first, actually

emilypi
emilypi previously approved these changes Dec 9, 2022
Copy link
Member

@emilypi emilypi left a comment

Choose a reason for hiding this comment

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

Wonderful! thanks @qooboodoop

@emilypi emilypi dismissed their stale review December 9, 2022 19:47

Gonna try it myself!

Copy link
Contributor

@jwiegley jwiegley left a comment

Choose a reason for hiding this comment

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

Ok, ran it here and it all looks good to me. Thank you!

@jwiegley jwiegley merged commit 581242e into kadena-io:master Dec 9, 2022
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

3 participants