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

Sync feature/string-templates branch with master #3657

Merged
merged 76 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
298fa4d
Remove checking and parsing from suite, fix windows issues.
RZhang05 Oct 16, 2024
8ce8986
Update flow-go version to pass tests.
RZhang05 Oct 17, 2024
314bca6
Update to latest cadence version.
RZhang05 Oct 17, 2024
8800bfe
Fix formatting, add versioning back.
RZhang05 Oct 17, 2024
2874423
remove Crypto contract
turbolent Oct 17, 2024
393e955
call constructor for contracts loaded from identifier location, test
turbolent Oct 17, 2024
bc51dde
remove Flow CLI and testing from CI job
turbolent Oct 18, 2024
4f3e6fa
Remove unused code, always use latest flow-go version.
RZhang05 Oct 18, 2024
2d0b760
Merge branch 'master' of https://github.com/onflow/cadence into basti…
SupunS Oct 18, 2024
7253dcd
Merge branch 'master' of https://github.com/onflow/cadence into basti…
SupunS Oct 18, 2024
2fcd4c5
fix dependencies / breakage due to restructuring
turbolent Oct 18, 2024
0ffd972
Merge branch 'master' into source-compatibility-update
turbolent Oct 18, 2024
02b9413
remove All function again, export field instead
turbolent Oct 18, 2024
8805722
Remove unused files property.
RZhang05 Oct 18, 2024
69bd725
Merge branch 'source-compatibility-update' of https://github.com/RZha…
RZhang05 Oct 18, 2024
bdf0912
Merge pull request #3616 from RZhang05/source-compatibility-update
turbolent Oct 18, 2024
2e72919
revert 393e95547139475504f4dd91681b6b92c6405496: use resolve location…
turbolent Oct 18, 2024
d2f3abc
Merge pull request #3627 from onflow/bastian/fix-storage-explorer-2
turbolent Oct 18, 2024
009255f
bring back license header
turbolent Oct 18, 2024
db075f7
v1.1.0
SupunS Oct 18, 2024
0b1fc2b
Merge pull request #3628 from onflow/release/v1.1.0
turbolent Oct 18, 2024
bd46d4f
Update release docs with a section for versioning strategy
SupunS Oct 18, 2024
7f1b6fb
Merge branch 'master' into bastian/3135-move-crypto-contract-onchain
turbolent Oct 18, 2024
cf0472b
Cleanup outdated FT/NFT related contract codes and tests
SupunS Oct 18, 2024
df33ab8
Merge pull request #3619 from onflow/bastian/3135-move-crypto-contrac…
turbolent Oct 18, 2024
f52a7ed
Fix contracts backward compatibility checker
SupunS Oct 18, 2024
d96a90d
Merge pull request #3630 from onflow/supun/cleanup
SupunS Oct 18, 2024
2ee8c64
re-enable and update the Source Compatiblity Suite GitHub action
turbolent Oct 18, 2024
e020579
update email addresses
turbolent Oct 18, 2024
4934d4a
v1.2.0
turbolent Oct 21, 2024
cfd6412
Fix resolving crypto contract
SupunS Oct 21, 2024
03908ce
resolve location of imported values
turbolent Oct 21, 2024
6585620
Merge branch 'master' into bastian/resolve-value-import-location
turbolent Oct 21, 2024
553c7ee
Merge pull request #3632 from onflow/bastian/reenable-compat-suite-ac…
turbolent Oct 21, 2024
0170c96
Merge pull request #3629 from onflow/supun/versioning
turbolent Oct 21, 2024
8f1bb54
Merge pull request #3633 from onflow/release/v1.2.0
turbolent Oct 21, 2024
1662018
Merge pull request #3634 from onflow/bastian/resolve-value-import-loc…
turbolent Oct 21, 2024
8408a3f
Temporarily provide source code for Cypto contract
SupunS Oct 21, 2024
237ddb7
Pass chain-id as argument
SupunS Oct 21, 2024
3002f18
remove meeting notes
turbolent Oct 21, 2024
1bae18b
v1.2.1
turbolent Oct 21, 2024
2c82486
Merge pull request #3635 from onflow/bastian/remove-meeting-notes
turbolent Oct 21, 2024
9b853da
Merge pull request #3636 from onflow/release/v1.2.1
turbolent Oct 21, 2024
8b27276
Merge pull request #3631 from onflow/supun/update-contracts-checker
SupunS Oct 22, 2024
95eb472
Update CCF CDDL for IntersectionType to match codec
fxamacker Oct 23, 2024
3815ec4
Merge pull request #3640 from onflow/fxamacker/update-ccf-cddl-in-com…
fxamacker Oct 23, 2024
d3403dc
flixkit-go is now v2
turbolent Oct 23, 2024
85f46f7
Merge pull request #3641 from onflow/bastian/update-update-tool-config
turbolent Oct 23, 2024
0e1b932
Remove attachments enabling flag
SupunS Oct 23, 2024
af8e417
Merge pull request #3642 from onflow/supun/cleanup-attachments-flag
SupunS Oct 23, 2024
e3c3821
Fix and improve CCF CDDL in comments
fxamacker Oct 24, 2024
c4e631e
Merge pull request #3643 from onflow/fxamacker/update-ccf-cddl-in-com…
fxamacker Oct 24, 2024
babf34a
run Cadence tests
turbolent Oct 24, 2024
3fe049d
Update README.md
franklywatson Oct 26, 2024
aa3809d
Update index.tsx
franklywatson Oct 26, 2024
0b92557
Merge pull request #3646 from onflow/jp-c1.0-mop-up
turbolent Oct 28, 2024
aceb884
update old uses of pub and priv
turbolent Oct 28, 2024
a0ef085
document Go patterns used in the codebase
turbolent Oct 28, 2024
52bbfa4
move architecture diagram to contributor documentation directory
turbolent Oct 28, 2024
dccae9a
move runtime tests
turbolent Oct 28, 2024
08eae83
fix test expectation
turbolent Oct 28, 2024
ed36b6c
remove outdated gitattributes for old parser
turbolent Oct 28, 2024
258b177
move checker tests to sema package
turbolent Oct 28, 2024
0f5d513
move occurrence matcher
turbolent Oct 28, 2024
a6da1a0
move interpreter tests
turbolent Oct 28, 2024
bc3bc62
bring back access tests
turbolent Oct 28, 2024
782db6c
refactor test utils
turbolent Oct 29, 2024
ff8d29d
adjust paths
turbolent Oct 29, 2024
e20bd56
Merge pull request #3651 from onflow/bastian/refactor-tests
turbolent Oct 29, 2024
0f382af
Merge pull request #3650 from onflow/bastian/move-architecture-diagram
turbolent Oct 29, 2024
1c029f3
Merge pull request #3649 from onflow/bastian/document-go-patterns
turbolent Oct 29, 2024
63d3591
Merge pull request #3652 from onflow/bastian/refactor-test-utils
turbolent Oct 29, 2024
335ace9
Merge pull request #3647 from onflow/bastian/pub-priv-cleanup
turbolent Oct 30, 2024
1399a6d
Merge pull request #3644 from onflow/bastian/compat-suite-cadence-tests
turbolent Oct 30, 2024
f3b4828
Merge branch 'master' of https://github.com/onflow/cadence into featu…
SupunS Oct 30, 2024
f642b8e
Fix tests
SupunS Oct 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,12 @@ jobs:
go-version: ${{ env.GO_VERSION }}
cache: true

- name: Install Flow CLI
run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"

- name: Build
run: make -j8 build

- name: Test
run: make ci

- name: Cadence Testing Framework
run: cd stdlib/contracts && flow test --cover --covercode="contracts" crypto_test.cdc

- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/compat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Source Compatibility Suite
on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
inputs:

jobs:
source-compat:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Install dependencies
working-directory: compat
run: pip3 install -r requirements.txt
- name: Run
working-directory: compat
run: "python3 main.py"
34 changes: 0 additions & 34 deletions .github/workflows/compat.yaml.disabled

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/compatibility-check-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: |
GOPROXY=direct go mod edit -replace github.com/onflow/cadence=github.com/${{ inputs.repo }}@${{ inputs.current-branch }}
go mod tidy
go run ./cmd/check_contracts/main.go ../../tmp/contracts.csv ../../tmp/output-new.txt
go run ./cmd/check_contracts/main.go flow-${{ inputs.chain }} ../../tmp/contracts.csv ../../tmp/output-new.txt

# Check contracts using base branch

Expand All @@ -97,7 +97,7 @@ jobs:
run: |
GOPROXY=direct go mod edit -replace github.com/onflow/cadence=github.com/${{ inputs.repo }}@`git rev-parse origin/${{ inputs.base-branch }}`
go mod tidy
go run ./cmd/check_contracts/main.go ../../tmp/contracts.csv ../../tmp/output-old.txt
go run ./cmd/check_contracts/main.go flow-${{ inputs.chain }} ../../tmp/contracts.csv ../../tmp/output-old.txt

# Upload checking results for later use

Expand Down
23 changes: 18 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ build: build-tools ./cmd/parse/parse ./cmd/parse/parse.wasm ./cmd/check/check ./
go build -o $@ ./cmd/main

.PHONY: build-tools
build-tools: build-analysis build-get-contracts
build-tools: build-analysis build-get-contracts build-compatibility-check

.PHONY: build-analysis
build-analysis:
Expand All @@ -55,19 +55,32 @@ build-analysis:
build-get-contracts:
(cd ./tools/get-contracts && go build .)

.PHONY: build-compatibility-check
build-compatibility-check:
(cd ./tools/compatibility-check && go build .)

.PHONY: ci
ci:
# test all packages
go test -coverprofile=coverage.txt -covermode=atomic -parallel 8 -race -coverpkg $(COVERPKGS) ./...
# run interpreter smoke tests. results from run above are reused, so no tests runs are duplicated
go test -count=5 ./tests/interpreter/... -runSmokeTests=true -validateAtree=false
go test -count=5 ./interpreter/... -runSmokeTests=true -validateAtree=false
# remove coverage of empty functions from report
sed -i -e 's/^.* 0 0$$//' coverage.txt

.PHONY: test
test:
# test all packages
go test -parallel 8 ./...
test: test-all-packages test-tools

.PHONY: test-all-packages
test-all-packages:
(go test -parallel 8 ./...)

.PHONY: test-tools
test-tools:
(cd ./tools/analysis && go test -parallel 8 ./)
(cd ./tools/compatibility-check && go test -parallel 8 ./)
(cd ./tools/constructorcheck && go test -parallel 8 ./)
(cd ./tools/maprange && go test -parallel 8 ./)

.PHONY: lint-github-actions
lint-github-actions: build-linter
Expand Down
24 changes: 22 additions & 2 deletions ast/inspector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,37 @@ import (

"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/tests/examples"
)

// TestInspector_Elements compares Inspector against Inspect.
func TestInspector_Elements(t *testing.T) {

t.Parallel()

const code = `
access(all) contract interface FungibleToken {

access(all) resource interface Provider {
access(all) fun withdraw(amount: Int): @Vault
}

access(all) resource interface Receiver {
access(all) fun deposit(vault: @Vault)
}

access(all) resource interface Vault: Provider, Receiver {
access(all) balance: Int
}

access(all) fun absorb(vault: @Vault)

access(all) fun sprout(balance: Int): @Vault
}
`

program, err := parser.ParseProgram(
nil,
[]byte(examples.FungibleTokenContractInterface),
[]byte(code),
parser.Config{},
)
require.NoError(t, err)
Expand Down
8 changes: 0 additions & 8 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ func DefaultCheckerConfig(
importedLocation common.Location,
_ ast.Range,
) (sema.Import, error) {
if importedLocation == stdlib.CryptoCheckerLocation {
cryptoChecker := stdlib.CryptoChecker()
return sema.ElaborationImport{
Elaboration: cryptoChecker.Elaboration,
}, nil
}

stringLocation, ok := importedLocation.(common.StringLocation)
if !ok {
return nil, &sema.CheckerError{
Expand All @@ -126,7 +119,6 @@ func DefaultCheckerConfig(
Elaboration: importedChecker.Elaboration,
}, nil
},
AttachmentsEnabled: true,
}
}

Expand Down
6 changes: 3 additions & 3 deletions cmd/info/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
"github.com/onflow/cadence/tests/checker"
"github.com/onflow/cadence/test_utils/sema_utils"
)

type command struct {
Expand Down Expand Up @@ -80,7 +80,7 @@ var commands = map[string]command{

func dumpBuiltinTypes() {

allBaseSemaTypes := checker.AllBaseSemaTypes()
allBaseSemaTypes := sema_utils.AllBaseSemaTypes()

types := make([]sema.Type, 0, len(allBaseSemaTypes))

Expand Down Expand Up @@ -239,7 +239,7 @@ func dumpBuiltinValues() {
ty sema.Type
}

allBaseSemaValueTypes := checker.AllBaseSemaValueTypes()
allBaseSemaValueTypes := sema_utils.AllBaseSemaValueTypes()
standardLibraryValues := stdlib.DefaultScriptStandardLibraryValues(nil)

valueTypes := make([]valueType, 0, len(allBaseSemaValueTypes)+len(standardLibraryValues))
Expand Down
Loading
Loading