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

Allow moveTime function to accept negative time deltas for going backwards in time #2734

Merged

Conversation

m-Peter
Copy link
Contributor

@m-Peter m-Peter commented Aug 18, 2023

Companion PR: onflow/cadence-tools#196

Description

Change the delta argument type from UFix64 to Fix64.

import Test

pub fun testMoveBackward() {
    let blockchain = Test.newEmulatorBlockchain()
    // timeDelta is the representation of 35 days,
    // in the form of seconds. A negative time delta
    // signifies going back in time.
    let timeDelta = Fix64(35 * 24 * 60 * 60) * -1.0
    blockchain.moveTime(by: timeDelta)
}

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #2734 (a8e229a) into master (893aea8) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2734   +/-   ##
=======================================
  Coverage   79.15%   79.15%           
=======================================
  Files         333      333           
  Lines       78379    78379           
=======================================
  Hits        62037    62037           
  Misses      14044    14044           
  Partials     2298     2298           
Flag Coverage Δ
unittests 79.15% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
runtime/stdlib/test_emulatorbackend.go 54.94% <100.00%> (ø)

@turbolent turbolent merged commit 75714d7 into onflow:master Aug 18, 2023
@m-Peter m-Peter deleted the testing-framework-move-time-backward branch August 25, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants