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

Update all tests to the latest framework's API #5

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

m-Peter
Copy link
Owner

@m-Peter m-Peter commented Oct 16, 2023

The latest flow-cli release (v1.5.01) includes quite some changes to the API.

@m-Peter m-Peter self-assigned this Oct 16, 2023
"ApprovalVoting": {
"source": "contracts/ApprovalVoting.cdc",
"aliases": {
"testing": "0x0000000000000007"

Choose a reason for hiding this comment

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

This is interesting! Curious about how we determine the testing address and how the testing alias is used

Copy link
Owner Author

Choose a reason for hiding this comment

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

Hey @sisyphusSmiling 👋
Basically, I borrowed an idea from Flow Playground, where we use simple, sequential addresses to be easier to deal with. The testing framework now offers a pool a 10 predefined accounts, where users can deploy their contracts under testing.

import Test
import BlockchainHelpers
import "ApprovalVoting"

access(all) let admin = Test.getAccount(0x0000000000000007)

access(all)
fun testInitializeEmptyProposals() {
    let txResult = executeTransaction(
        "../transactions/initialize_proposals.cdc",
        [proposals],
        admin
    )
}

Developers can also gain access to this account, in order to use it for signing transactions.
Stay tuned as I am going to update all relevant projects with the new API, including HybridCustody

@m-Peter m-Peter force-pushed the update-tests-with-latest-features branch from 22d5355 to 0d7926b Compare October 31, 2023 10:57
@m-Peter m-Peter marked this pull request as ready for review October 31, 2023 10:57
@codecov
Copy link

codecov bot commented Oct 31, 2023

Codecov Report

Merging #5 (d10a5fa) into main (4e724c4) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main       #5   +/-   ##
=======================================
  Coverage   99.14%   99.14%           
=======================================
  Files           4        4           
  Lines         117      117           
=======================================
  Hits          116      116           
  Misses          1        1           
Files Coverage Δ
contracts/StringUtils.cdc 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@m-Peter m-Peter force-pushed the update-tests-with-latest-features branch from 0d7926b to d10a5fa Compare October 31, 2023 11:01
@m-Peter m-Peter merged commit 67c8d52 into main Nov 2, 2023
3 checks passed
@m-Peter m-Peter deleted the update-tests-with-latest-features branch November 2, 2023 13:27
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