-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/onflow/cadence into supun…
…/vm-cadence-1.0
- Loading branch information
Showing
276 changed files
with
5,453 additions
and
3,112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,7 @@ jobs: | |
path: | | ||
./tmp/output-old.txt | ||
./tmp/output-new.txt | ||
./tmp/contracts.csv | ||
# Check Diff | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Get contracts | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
chain: | ||
required: true | ||
type: string | ||
secrets: | ||
FLOWDIVER_API_KEY: | ||
required: true | ||
|
||
env: | ||
GO_VERSION: '1.22' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.run_id }}-${{ inputs.chain }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
cache: true | ||
|
||
- name: Make output dirs | ||
run: | | ||
mkdir tmp | ||
# Get contracts | ||
|
||
- name: Download contracts | ||
env: | ||
FLOWDIVER_API_KEY: ${{ secrets.FLOWDIVER_API_KEY }} | ||
working-directory: ./tools/get-contracts | ||
run: | | ||
go run . --chain=${{ inputs.chain }} --apiKey="$FLOWDIVER_API_KEY" > ../../tmp/contracts.csv | ||
# Upload | ||
|
||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ inputs.chain }}-contracts | ||
path: | | ||
./tmp/contracts.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Cadence - The resource-oriented smart contract programming language | ||
* | ||
* Copyright Flow Foundation | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package ast | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/turbolent/prettier" | ||
) | ||
|
||
func TestStringTemplate_Doc(t *testing.T) { | ||
|
||
t.Parallel() | ||
|
||
stmt := &StringTemplateExpression{ | ||
Values: []string{ | ||
"abc", | ||
}, | ||
Expressions: []Expression{}, | ||
Range: Range{ | ||
StartPos: Position{Offset: 4, Line: 2, Column: 3}, | ||
EndPos: Position{Offset: 11, Line: 2, Column: 10}, | ||
}, | ||
} | ||
|
||
assert.Equal(t, | ||
prettier.Text("\"abc\""), | ||
stmt.Doc(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.