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 stable-cadence branch with master #2455

Merged
merged 201 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
201 commits
Select commit Hold shift + click to select a range
f400c35
Bump fxamacker/cbor stream-mode branch to latest
fxamacker Feb 28, 2023
86cda98
Create metered UFix64/Fix64 from uint64/int64
fxamacker Feb 28, 2023
0b621a7
Add CCF codec implementating CCF Specs (RC1)
fxamacker Feb 28, 2023
a2c6bc0
Add CCF codec tests
fxamacker Feb 28, 2023
a3d00ba
Add CCF codec benchmarks
fxamacker Feb 28, 2023
4c4b6cb
Remove valid UTF-8 check in encodeString
fxamacker Mar 1, 2023
e0af91f
Close the cbor.StreamEncoder in ccf.Encode()
fxamacker Mar 1, 2023
d8bb861
Refactor CCF encoder error handling
fxamacker Mar 1, 2023
4b303bf
Refactor CCF decoder error handling
fxamacker Mar 1, 2023
8f5c69c
Panic if Cadence value has nil type in CCF encoder
fxamacker Mar 1, 2023
1556c4f
Fix linter errors
fxamacker Mar 1, 2023
f911063
Fix goimports linter errors
fxamacker Mar 1, 2023
82e1812
Remove copyright years since it's in NOTICE
fxamacker Mar 14, 2023
2ce376a
Replace for-loop with range-loop for readability
fxamacker Mar 14, 2023
a13c450
Merge branch 'master' into fxamacker/ccf-codec
fxamacker Mar 14, 2023
f89eb06
Update code comments to match latest CCF Specs
fxamacker Mar 14, 2023
42d8657
Update code comments to match latest CCF Specs
fxamacker Mar 14, 2023
266fb6a
Check for "zero or more" sortable items
fxamacker Mar 14, 2023
4aa5f6b
Refactor error handling and use UnexpectedError
fxamacker Mar 15, 2023
bc220dc
Improve CCF error messages
fxamacker Mar 15, 2023
cae3f98
Add comments and instructions for updating CCF tags
fxamacker Mar 15, 2023
ef5f6d9
Reuse restricted type ID during CCF decoding
fxamacker Mar 15, 2023
8791232
Cleanup some comments and code from PR review
fxamacker Mar 15, 2023
588594e
Decode CCF (U)Int128 and (U)Int256 in metered funcs
fxamacker Mar 15, 2023
2e6e4a4
Decode CCF dictionary in metered function
fxamacker Mar 15, 2023
9d172c9
Clarify comments about CCF sorting
fxamacker Mar 16, 2023
36b52d7
Add comments for encodeTypeValue and encodeFunction
fxamacker Mar 16, 2023
705fdd5
Simplify CCF encodeOptional()
fxamacker Mar 16, 2023
852c527
Revert accidental changes to .golangci.yml
fxamacker Mar 16, 2023
cd55481
Move sorted field cache from global to CCF encoder
fxamacker Mar 16, 2023
3350596
Add CCF type ID related tests
fxamacker Mar 17, 2023
b20b4b1
Abbreviate comments to use json-cdc
fxamacker Mar 17, 2023
657e4ed
Fix lint errors
fxamacker Mar 17, 2023
60d132c
Remove RawType comparison in EnumType.Equal()
fxamacker Mar 21, 2023
7624694
Add more CCF codec tests for array
fxamacker Mar 21, 2023
46925ec
Add CCF codec test for Enum
fxamacker Mar 21, 2023
c233780
Fix CCF encoding edge case for optional value
fxamacker Mar 22, 2023
1fdd954
Merge branch 'master' into fxamacker/ccf-codec
fxamacker Mar 22, 2023
24dcca6
Update CCF encoder to use DictionaryType directly
fxamacker Mar 22, 2023
49d23b1
Add comment for OptionalType{NeverType} edge case
fxamacker Mar 22, 2023
cadecce
Add more CCF tests
fxamacker Mar 23, 2023
9672fa4
Add more CCF tests
fxamacker Mar 23, 2023
f7c2d9f
Add more CCF tests
fxamacker Mar 23, 2023
91fba70
Add ccf test for value of restricted type
fxamacker Mar 23, 2023
7a1b3f5
Remove cadence-type-id from restricted-type(-value)
fxamacker Mar 24, 2023
54c6987
Remove cadence-type-id from function-value
fxamacker Mar 24, 2023
7715d56
Update CCF test
fxamacker Mar 24, 2023
efc5dc5
remove link decoding from JSON-CDC
turbolent Mar 24, 2023
587700e
add cadence.AccountLink
turbolent Mar 24, 2023
d78f2f7
Revert FunctionType & RestrictedType typeID change
fxamacker Mar 24, 2023
490bcbd
remove type ID from function type and restricted type
turbolent Mar 24, 2023
76a322d
improve reference type ID generation
turbolent Mar 24, 2023
c5c2782
refactor capability type ID formatting
turbolent Mar 24, 2023
11e8830
use faster WriteByte instead of WriteRune
turbolent Mar 24, 2023
fd46833
simplify reference type string formatting
turbolent Mar 24, 2023
1008020
refactor restricted type ID formatting
turbolent Mar 24, 2023
4a5105a
refactor function type ID formatting
turbolent Mar 24, 2023
eb11e52
Return error if decoded size isn't same as received
fxamacker Mar 24, 2023
8c43d33
include type parameter name instead of bound
turbolent Mar 24, 2023
3332390
add type parameters to cadence package
turbolent Mar 24, 2023
9a6490d
implement function type ID
turbolent Mar 24, 2023
ee36092
Add CCF support for reference type as static type
fxamacker Mar 24, 2023
0e6fb36
Add more CCF tests
fxamacker Mar 24, 2023
82cbfd3
Remove traversing cadence.Enum for composite type
fxamacker Mar 24, 2023
42a364c
Add more CCF tests
fxamacker Mar 24, 2023
241ec38
Add sanity check for retrieved sorted field from cache
fxamacker Mar 24, 2023
27d1ec6
Check unexpected nil type in CCF decoder
fxamacker Mar 28, 2023
3245e84
Add test for decoding extraneous CCF data
fxamacker Mar 28, 2023
205d09c
Fix lint error
fxamacker Mar 28, 2023
70efc68
Fix restricted types sorting in CCF
fxamacker Mar 29, 2023
6fa154e
Fix CCF encoding of value of optional reference type
fxamacker Mar 29, 2023
330b9a8
Fix CCF decoding of type value of recursive inits
fxamacker Mar 29, 2023
06a6d73
Check encoded but unreferenced type def in CCF
fxamacker Mar 29, 2023
e053a23
Update accounts.mdx
MaxStalker Mar 30, 2023
0758547
update dependencies
turbolent Mar 30, 2023
b4e1494
Check cyclic storage references during export
SupunS Mar 29, 2023
dd45746
update aurora
turbolent Mar 30, 2023
3cc78b8
update wasmtime-go and pp
turbolent Mar 30, 2023
37f2284
Fix abstract type caching during CCF type traversal
fxamacker Mar 30, 2023
1802700
remove outdated TODO
turbolent Mar 30, 2023
03e30ea
Merge pull request #2409 from onflow/supun/fix-reference-returns
SupunS Mar 30, 2023
f20f3ae
also compare type parameters
turbolent Mar 30, 2023
1d22675
pre-allocate
turbolent Mar 30, 2023
3f90c88
optimize restriction set
turbolent Mar 30, 2023
09eea5d
lint
turbolent Mar 30, 2023
bf50554
v0.38.0
SupunS Mar 30, 2023
5bfce97
Merge pull request #2401 from onflow/bastian/improve-link-export-import
turbolent Mar 30, 2023
3224e60
Merge pull request #2411 from onflow/release/v0.38.0
SupunS Mar 31, 2023
088de78
remove parameter names when argument labels are given
turbolent Mar 31, 2023
9999690
Merge branch 'master' into fxamacker/ccf-codec
fxamacker Mar 31, 2023
30ab566
Update to use latest Cadence APIs
fxamacker Mar 31, 2023
c885b1f
Remove outdated test
fxamacker Mar 31, 2023
6ddbd88
WIP: Allow equality comparisons for dictionaries
darkdrag00nv2 Apr 2, 2023
66d1c81
Add tests in interpreter_test and complete documentation
darkdrag00nv2 Apr 2, 2023
ac4ebf9
Improve test for Merge method on CoverageReport type
m-Peter Apr 3, 2023
ce732a8
Introduce a CoverageReport field on runtime.Config type
m-Peter Apr 3, 2023
cc5644b
Completely remove CoverageReportingEnabled field from runtime.Config …
m-Peter Apr 3, 2023
271ade7
add support for generating code of nested types
turbolent Apr 3, 2023
a7a49d2
do not import sema in code generator
turbolent Apr 3, 2023
1c087d0
do not produce cyclic import
turbolent Apr 3, 2023
d19ad1e
Remove sorting of composite initializer parameters
fxamacker Apr 3, 2023
4e15605
simplify simple type member resolvers, avoid allocation on access
turbolent Apr 3, 2023
a5b4e28
generated members for nested composite types
turbolent Apr 3, 2023
d546be3
lint
turbolent Apr 3, 2023
1a14892
move composite type member initialization to init function to allow f…
turbolent Apr 3, 2023
2a45bfe
handle nested identifiers
turbolent Apr 3, 2023
c77f9af
lint
turbolent Apr 3, 2023
b18e260
Allow only 0 or 1 composite type initializers in CCF
fxamacker Apr 3, 2023
e23dfc7
Remove a redundant comment in CCF test
fxamacker Apr 3, 2023
32e8af8
refactor AuthAccount and PublicAccount types, as well as their nested…
turbolent Apr 3, 2023
6fa530e
update documentation
turbolent Apr 3, 2023
41f75d7
Merge pull request #2416 from Build-Squad/runtime-config-coverage-rep…
turbolent Apr 3, 2023
9f7dfed
Support FunctionType.TypeParameters in CCF codec
fxamacker Apr 3, 2023
1522709
generate simple type members in init function to allow for cycles
turbolent Apr 3, 2023
011a1ce
refactor DeployedContract definition to Cadence
turbolent Apr 3, 2023
1546ddd
optimize String type members: avoid allocation on access
turbolent Apr 3, 2023
4aaaacd
refactor Character type to Cadence
turbolent Apr 3, 2023
0e532e4
optimize MetaType members: avoid allocation on access
turbolent Apr 3, 2023
d4af661
optimize member resolvers of some more types
turbolent Apr 3, 2023
7801f01
Resolve review comments:
darkdrag00nv2 Apr 4, 2023
2e136e6
Merge pull request #2414 from darkdrag00nv2/eq_dict_2275
turbolent Apr 4, 2023
8288421
remove old code
turbolent Apr 4, 2023
2d623c9
Support nullable types in CCF codec
fxamacker Apr 4, 2023
79bba60
Merge pull request #2407 from onflow/bastian/update-dependencies
turbolent Apr 4, 2023
ac8154e
optimize Address type member resolvers
turbolent Apr 4, 2023
63237bf
optimize restricted type member resolvers
turbolent Apr 4, 2023
f62e262
optimize Capability type member resolvers
turbolent Apr 4, 2023
ecc3efd
Update handling of atree errors
fxamacker Apr 5, 2023
c669989
improve type of cadence.Path.domain, ensure it is not unknown
turbolent Apr 5, 2023
2923c9c
return path subtype
turbolent Apr 5, 2023
5658ba1
test script with storage path parameter
turbolent Apr 5, 2023
c3507cb
test contract deployment with storage path contract initializer param…
turbolent Apr 5, 2023
574c3ca
Merge pull request #2417 from onflow/bastian/nested-type-code-generation
turbolent Apr 5, 2023
347953b
Merge pull request #2418 from onflow/bastian/refactor-account-types
turbolent Apr 6, 2023
73cb3b3
Merge branch 'master' into bastian/optimize-simple-types
turbolent Apr 6, 2023
dc93a87
regenerate files
turbolent Apr 6, 2023
2eda2b8
Merge pull request #2419 from onflow/bastian/optimize-simple-types
turbolent Apr 6, 2023
d5753f9
Bump onflow/atree to v0.6.0
fxamacker Apr 6, 2023
a027712
Merge pull request #2426 from onflow/fxamacker/update-atree-error-han…
fxamacker Apr 6, 2023
cb2a7c8
Merge branch 'master' into max/fix-arg-name
turbolent Apr 6, 2023
2bb742f
Merge pull request #2406 from MaxStalker/max/fix-arg-name
turbolent Apr 6, 2023
caacb28
Add the 'not' built-in matcher combinator
m-Peter Apr 4, 2023
9a54823
Add the 'beSucceeded' built-in matcher function
m-Peter Apr 4, 2023
d725d77
Add the 'beFailed' built-in matcher function
m-Peter Apr 4, 2023
54475e2
Add the 'beNil' built-in matcher function
m-Peter Apr 4, 2023
7f7fb44
Add the 'beEmpty' built-in matcher function
m-Peter Apr 4, 2023
1f938a7
Add the 'haveElementCount' built-in matcher function
m-Peter Apr 4, 2023
6786bb8
Add the 'contain' built-in matcher function
m-Peter Apr 4, 2023
f595f72
Add the 'beGreaterThan' built-in matcher function
m-Peter Apr 4, 2023
c67f456
Add the 'beLessThan' built-in matcher function
m-Peter Apr 4, 2023
24bb27b
Declare the 'panic' function in the TestContractChecker
m-Peter Apr 5, 2023
dc31ba3
Improve error handling and error messages for the new matchers
m-Peter Apr 5, 2023
bad630c
Add a struct interface to abstract the result of an executed operation
m-Peter Apr 7, 2023
3428082
Panic with DefaultUserError instead of UnexpectedError
m-Peter Apr 8, 2023
74dc043
Update description for contain matcher function
m-Peter Apr 10, 2023
fee6a8a
Merge pull request #2427 from onflow/bastian/improve-paths
turbolent Apr 10, 2023
2f4cb0d
add basic support for multiline input
turbolent Apr 11, 2023
1541525
Merge pull request #2420 from Build-Squad/testing-framework-add-more-…
turbolent Apr 11, 2023
19f829f
Add more comments
fxamacker Apr 11, 2023
a9f8706
Merge branch 'master' into fxamacker/ccf-codec
fxamacker Apr 11, 2023
b8faff0
Update CCF codec to use newer PathValue in PR 2427
fxamacker Apr 11, 2023
8045558
Parallelize some CCF tests
fxamacker Apr 11, 2023
dbbbbd9
Refactor and rename functions
fxamacker Apr 11, 2023
926661c
Refactor to use same variable name in type switch
fxamacker Apr 11, 2023
80c9f49
Make CCF codec panic on implementation errors
fxamacker Apr 11, 2023
f6f08ee
Replace map of raw fields with slice for CCF decoder
fxamacker Apr 12, 2023
565f84e
Reduce CCF decoder limits for array and map elems
fxamacker Apr 12, 2023
12b7116
Deny indef length CBOR data items in CCF
fxamacker Apr 12, 2023
0939559
separate breaking changes
turbolent Apr 12, 2023
fbaf53a
Merge pull request #2435 from onflow/bastian/fix-release-notes-config
turbolent Apr 12, 2023
683ac15
Merge pull request #2434 from onflow/bastian/repl-multiline
turbolent Apr 12, 2023
c49628b
check for potential resource loss in reference expression
turbolent Apr 5, 2023
cb1f02a
Merge pull request #2437 from onflow/bastian/handle-reference-resourc…
turbolent Apr 12, 2023
3a8f622
update doc with regards to identity BLS public keys
Apr 12, 2023
0d227f8
add callouts
Apr 12, 2023
4f07b2e
Merge pull request #2439 from onflow/tarak/2394-BLS-doc
turbolent Apr 13, 2023
4a6aa57
Add more comments for CCF codec
fxamacker Apr 13, 2023
51552f1
Unwrap ref type when reducing inline type for CCF
fxamacker Apr 13, 2023
b6b29f2
Fix comment in CCF test
fxamacker Apr 13, 2023
6e5cb15
Replace recursion in getTypeToEncodeAsCCFInlineType
fxamacker Apr 13, 2023
a87f363
Merge pull request #2364 from onflow/fxamacker/ccf-codec
fxamacker Apr 13, 2023
adb8d5f
Fix built-in result variable for optional-typed returns
SupunS Apr 13, 2023
65ce61c
Refactor code
SupunS Apr 14, 2023
147e51e
Merge pull request #2444 from onflow/supun/fix-result-var
SupunS Apr 14, 2023
d2262a4
Add reference tracking for the result variable
SupunS Apr 14, 2023
53dad69
Check for other places where references are created internally
SupunS Apr 14, 2023
6c22a63
ADd resource reference tracking for attachments
SupunS Apr 17, 2023
b743004
Update tests
SupunS Apr 17, 2023
bda1a19
Add validation for exporting references to destroyed resources
SupunS Apr 18, 2023
30589cb
Update attachment export test
SupunS Apr 18, 2023
e2568eb
Merge pull request #2453 from onflow/supun/fix-reference-export
SupunS Apr 19, 2023
a0e3f52
Merge pull request #2447 from onflow/supun/resource-tracking
SupunS Apr 19, 2023
5ee6a45
Merge branch 'master' into supun/sync-stable-cadence
SupunS Apr 19, 2023
a4acb79
Fix matchers
SupunS Apr 19, 2023
cdeeabd
Update json encoding
SupunS Apr 19, 2023
19019ff
Fix auth_account sema type generation
SupunS Apr 19, 2023
46b6996
Fix reference invalidation
SupunS Apr 20, 2023
a8adeac
Update publicaccount.cdc with new cadence syntax
SupunS Apr 20, 2023
55510a9
Update docs
SupunS Apr 20, 2023
3d57ec1
Remove depricated APIs
SupunS Apr 24, 2023
8919359
Bump CBOR version
SupunS Apr 24, 2023
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
4 changes: 4 additions & 0 deletions encoding/ccf/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2003,8 +2003,12 @@ func (d *Decoder) decodeFunctionTypeValue(visited *cadenceTypeByCCFTypeID) (cade
return nil, errors.New("unexpected nil function return type")
}

// TODO:
purity := cadence.FunctionPurityUnspecified

SupunS marked this conversation as resolved.
Show resolved Hide resolved
return cadence.NewMeteredFunctionType(
d.gauge,
purity,
typeParameters,
parameters,
returnType,
Expand Down
1 change: 0 additions & 1 deletion encoding/ccf/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func Encode(value cadence.Value) ([]byte, error) {
var w bytes.Buffer

enc := NewEncoder(&w)
defer enc.enc.Close()
SupunS marked this conversation as resolved.
Show resolved Hide resolved

err := enc.Encode(value)
if err != nil {
Expand Down
14 changes: 8 additions & 6 deletions encoding/json/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2459,15 +2459,16 @@ func TestEncodeType(t *testing.T) {
Parameters: []cadence.Parameter{
{Label: "qux", Identifier: "baz", Type: cadence.StringType{}},
},
ReturnType: cadence.IntType{},
ReturnType: cadence.IntType{},
TypeParameters: []cadence.TypeParameter{},
},
},
`{"type":"Type","value":{"staticType":
{
"kind" : "Function",
"typeID":"Foo",
"purity": "view",
"return" : {"kind" : "Int"},
"return" : {"kind" : "Int"},
"typeParameters": [],
"parameters" : [
{"label" : "qux", "id" : "baz", "type": {"kind" : "String"}}
]}
Expand All @@ -2482,8 +2483,8 @@ func TestEncodeType(t *testing.T) {
encodedValue := `{"type":"Type","value":{"staticType":
{
"kind" : "Function",
"typeID":"Foo",
"return" : {"kind" : "Int"},
"return" : {"kind" : "Int"},
"typeParameters": [],
"parameters" : [
{"label" : "qux", "id" : "baz", "type": {"kind" : "String"}}
]}
Expand All @@ -2495,7 +2496,8 @@ func TestEncodeType(t *testing.T) {
Parameters: []cadence.Parameter{
{Label: "qux", Identifier: "baz", Type: cadence.StringType{}},
},
ReturnType: cadence.IntType{},
ReturnType: cadence.IntType{},
TypeParameters: []cadence.TypeParameter{},
},
}

Expand Down
2 changes: 1 addition & 1 deletion types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func TestType_ID(t *testing.T) {
},
ReturnType: StringType{},
},
"((Int):String)",
"fun(Int):String",
},
{
&EventType{
Expand Down