Skip to content

Commit

Permalink
Merge pull request #789 from onflow/fix-examples
Browse files Browse the repository at this point in the history
Update Cadence code to Cadence 1.0
  • Loading branch information
nialexsan authored Sep 11, 2024
2 parents 88ecfaa + ce23092 commit 88a91fb
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 666 deletions.
39 changes: 1 addition & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,4 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: make ci

cypress-e2e:
name: Cypress Emulator Tests for Flow-Playground
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm install

- name: Spin up docker backend
run: npm run start-docker

- name: Cypress run emulator
uses: cypress-io/github-action@v4
with:
start: npm run start
wait-on: http://localhost:3000
spec: cypress/e2e/playground.cy.ts
record: true
browser: chrome
env:
PLAYGROUND_API: 'http://localhost:8080'
CYPRESS_RECORD_KEY: '${{ secrets.CYPRESS_RECORD_KEY }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos

5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,4 @@ yarn-error.log*
# ides
.idea
.vscode

# tests
cypress/videos
cypress/screenshots
.vercel
15 changes: 0 additions & 15 deletions cypress.config.ts

This file was deleted.

127 changes: 0 additions & 127 deletions cypress/e2e/playground.cy.ts

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

37 changes: 0 additions & 37 deletions cypress/support/commands.ts

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/support/e2e.ts

This file was deleted.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build": "webpack --mode=production",
"graphql:codegen": "npx graphql-codegen --config codegen.yml",
"test": "echo Tests command not implemented.",
"format:app": "prettier --write 'src' 'cypress'",
"format:check:app": "prettier --check 'src/**/*.{js,jsx,ts,tsx,css}' 'cypress/**/*.{js,jsx,ts,tsx,css}'",
"format:app": "prettier --write 'src'",
"format:check:app": "prettier --check 'src/**/*.{js,jsx,ts,tsx,css}' ",
"lint": "eslint --ext .js,.jsx,.ts,.tsx src",
"start-docker": "docker run -d -e FLOW_DEBUG=true -e FLOW_SESSIONCOOKIESSECURE=false -p 8080:8080 gcr.io/dl-flow/playground-api:latest ?",
"snyk-protect": "snyk protect",
Expand Down Expand Up @@ -99,7 +99,6 @@
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "5.2.7",
"cypress": "^13.0.0",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.23.1",
"eslint-plugin-jsx-a11y": "^6.6.1",
Expand Down
10 changes: 5 additions & 5 deletions src/providers/Project/projectDefault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ const HelloWorldContract = `// HelloWorld.cdc
// The HelloWorld contract contains a single string field and a public getter function.
//
// Follow the "Hello, World!" tutorial to learn more: https://docs.onflow.org/cadence/tutorial/02-hello-world/
pub contract HelloWorld {
access(all) contract HelloWorld {
// Declare a public field of type String.
//
// All fields must be initialized in the init() function.
pub var greeting: String
access(all) var greeting: String
// Public function that sets our friendly greeting!
// In your own applications you may want to tighten up this access control.
Expand All @@ -46,7 +46,7 @@ const DEFAULT_TRANSACTION = `import HelloWorld from 0x05
transaction(greeting: String) {
prepare(acct: AuthAccount) {
prepare(acct: &Account) {
log(acct.address)
}
Expand All @@ -58,8 +58,8 @@ transaction(greeting: String) {

const DEFAULT_SCRIPT = `import HelloWorld from 0x05
pub fun main() {
log(HelloWorld.hello())
access(all) fun main(): String {
return HelloWorld.hello()
}
`;

Expand Down
Loading

0 comments on commit 88a91fb

Please sign in to comment.