cadence
cadence copied to clipboard
Add path fields to `AuthAccount` and `PublicAccount`
Implementation of part of https://github.com/onflow/cadence/issues/208
Description
This adds new fields to AuthAccount
and PublicAccount
, containing the paths associated with that account in an array that can be interated upon. Both composites have the new publicPaths
field with type [PublicPath]
that contains all the public-domain things on the account. However, AuthAccount
also has privatePaths
and storagePaths
, with types [PrivatePath]
and [StoragePath]
respectively, that contain all the private-domain and storage-domain paths.
- [X] Targeted PR against
master
branch - [X] Linked to Github issue with discussion and accepted design OR link to spec that describes this work
- [X] Code follows the standards mentioned here
- [X] Updated relevant documentation
- [X] Re-reviewed
Files changed
in the Github PR explorer - [X] Added appropriate labels
Cadence Benchstat comparison
This branch with compared with the base branch onflow:master commit 674324f72f84fa87829928a3ac7a79725dd80885
The command for i in {1..N}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done
was used.
Bench tests were run a total of 7 times on each branch.
Collapsed results for better readability
old.txt | new.txt | |||
---|---|---|---|---|
time/op | delta | |||
CheckContractInterfaceFungibleTokenConformance-2 | 135µs ± 1% | 136µs ± 2% | ~ | (p=0.097 n=7+7) |
ContractInterfaceFungibleToken-2 | 40.1µs ± 1% | 40.4µs ± 2% | ~ | (p=0.366 n=7+6) |
InterpretRecursionFib-2 | 3.75ms ± 0% | 3.62ms ± 0% | −3.43% | (p=0.004 n=5+6) |
NewInterpreter/new_interpreter-2 | 1.18µs ± 0% | 1.18µs ± 1% | ~ | (p=0.133 n=6+7) |
NewInterpreter/new_sub-interpreter-2 | 2.47µs ± 1% | 2.47µs ± 1% | ~ | (p=1.000 n=6+7) |
ParseArray-2 | 8.81ms ± 5% | 8.66ms ± 2% | ~ | (p=0.620 n=7+7) |
ParseDeploy/byte_array-2 | 13.1ms ± 2% | 13.2ms ± 2% | ~ | (p=0.394 n=6+6) |
ParseDeploy/decode_hex-2 | 1.14ms ± 1% | 1.14ms ± 1% | ~ | (p=0.937 n=6+6) |
ParseFungibleToken/With_memory_metering-2 | 208µs ± 1% | 210µs ± 2% | ~ | (p=0.445 n=6+7) |
ParseFungibleToken/Without_memory_metering-2 | 160µs ± 1% | 161µs ± 2% | ~ | (p=0.366 n=6+7) |
ParseInfix-2 | 7.74µs ± 2% | 7.72µs ± 1% | ~ | (p=0.628 n=7+6) |
QualifiedIdentifierCreation/One_level-2 | 2.34ns ± 0% | 2.34ns ± 0% | ~ | (p=0.779 n=7+6) |
QualifiedIdentifierCreation/Three_levels-2 | 144ns ± 3% | 140ns ± 1% | −3.01% | (p=0.001 n=7+6) |
RuntimeFungibleTokenTransfer-2 | 930µs ±24% | 991µs ±22% | ~ | (p=0.620 n=7+7) |
RuntimeResourceDictionaryValues-2 | 6.45ms ± 2% | 6.24ms ± 3% | −3.15% | (p=0.004 n=7+7) |
ValueIsSubtypeOfSemaType-2 | 90.7ns ± 1% | 100.3ns ± 1% | +10.61% | (p=0.001 n=7+7) |
alloc/op | delta | |||
CheckContractInterfaceFungibleTokenConformance-2 | 62.4kB ± 0% | 62.4kB ± 0% | ~ | (p=1.000 n=7+7) |
ContractInterfaceFungibleToken-2 | 24.4kB ± 0% | 24.4kB ± 0% | ~ | (all equal) |
InterpretRecursionFib-2 | 1.51MB ± 0% | 1.51MB ± 0% | −0.00% | (p=0.021 n=7+7) |
NewInterpreter/new_interpreter-2 | 928B ± 0% | 928B ± 0% | ~ | (all equal) |
NewInterpreter/new_sub-interpreter-2 | 1.46kB ± 0% | 1.46kB ± 0% | ~ | (all equal) |
ParseArray-2 | 2.77MB ± 0% | 2.79MB ± 2% | ~ | (p=0.108 n=6+7) |
ParseDeploy/byte_array-2 | 4.42MB ± 3% | 4.45MB ± 3% | ~ | (p=0.932 n=7+7) |
ParseDeploy/decode_hex-2 | 214kB ± 0% | 214kB ± 0% | ~ | (p=0.828 n=7+7) |
ParseFungibleToken/With_memory_metering-2 | 36.3kB ± 0% | 36.3kB ± 0% | −0.03% | (p=0.013 n=7+7) |
ParseFungibleToken/Without_memory_metering-2 | 36.3kB ± 0% | 36.3kB ± 0% | ~ | (p=0.853 n=7+7) |
ParseInfix-2 | 2.17kB ± 0% | 2.17kB ± 0% | ~ | (p=0.054 n=7+7) |
QualifiedIdentifierCreation/One_level-2 | 0.00B | 0.00B | ~ | (all equal) |
QualifiedIdentifierCreation/Three_levels-2 | 64.0B ± 0% | 64.0B ± 0% | ~ | (all equal) |
RuntimeFungibleTokenTransfer-2 | 184kB ± 0% | 185kB ± 1% | ~ | (p=0.053 n=7+7) |
RuntimeResourceDictionaryValues-2 | 2.23MB ± 0% | 2.23MB ± 0% | ~ | (p=0.383 n=7+7) |
ValueIsSubtypeOfSemaType-2 | 48.0B ± 0% | 48.0B ± 0% | ~ | (all equal) |
allocs/op | delta | |||
CheckContractInterfaceFungibleTokenConformance-2 | 1.03k ± 0% | 1.03k ± 0% | ~ | (all equal) |
ContractInterfaceFungibleToken-2 | 428 ± 0% | 428 ± 0% | ~ | (all equal) |
InterpretRecursionFib-2 | 33.5k ± 0% | 33.5k ± 0% | ~ | (all equal) |
NewInterpreter/new_interpreter-2 | 13.0 ± 0% | 13.0 ± 0% | ~ | (all equal) |
NewInterpreter/new_sub-interpreter-2 | 42.0 ± 0% | 42.0 ± 0% | ~ | (all equal) |
ParseArray-2 | 70.0k ± 0% | 70.0k ± 0% | ~ | (p=1.000 n=7+7) |
ParseDeploy/byte_array-2 | 105k ± 0% | 105k ± 0% | ~ | (p=0.091 n=7+5) |
ParseDeploy/decode_hex-2 | 77.0 ± 0% | 77.0 ± 0% | ~ | (all equal) |
ParseFungibleToken/With_memory_metering-2 | 1.06k ± 0% | 1.06k ± 0% | ~ | (all equal) |
ParseFungibleToken/Without_memory_metering-2 | 1.06k ± 0% | 1.06k ± 0% | ~ | (all equal) |
ParseInfix-2 | 66.0 ± 0% | 66.0 ± 0% | ~ | (all equal) |
QualifiedIdentifierCreation/One_level-2 | 0.00 | 0.00 | ~ | (all equal) |
QualifiedIdentifierCreation/Three_levels-2 | 2.00 ± 0% | 2.00 ± 0% | ~ | (all equal) |
RuntimeFungibleTokenTransfer-2 | 3.48k ± 0% | 3.49k ± 0% | +0.18% | (p=0.001 n=7+7) |
RuntimeResourceDictionaryValues-2 | 37.1k ± 0% | 37.1k ± 0% | +0.01% | (p=0.001 n=7+7) |
ValueIsSubtypeOfSemaType-2 | 1.00 ± 0% | 1.00 ± 0% | ~ | (all equal) |
Codecov Report
Merging #1845 (d95465b) into master (674324f) will increase coverage by
0.02%
. The diff coverage is95.38%
.
@@ Coverage Diff @@
## master #1845 +/- ##
==========================================
+ Coverage 77.72% 77.75% +0.02%
==========================================
Files 294 294
Lines 62193 62258 +65
==========================================
+ Hits 48340 48408 +68
+ Misses 12129 12125 -4
- Partials 1724 1725 +1
Flag | Coverage Δ | |
---|---|---|
unittests | 77.75% <95.38%> (+0.02%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
Impacted Files | Coverage Δ | |
---|---|---|
runtime/interpreter/account.go | 88.88% <75.00%> (-1.19%) |
:arrow_down: |
runtime/interpreter/interpreter.go | 89.63% <100.00%> (+0.09%) |
:arrow_up: |
runtime/interpreter/storagemap.go | 83.21% <100.00%> (+4.69%) |
:arrow_up: |
runtime/sema/authaccount_type.go | 100.00% <100.00%> (ø) |
|
runtime/sema/publicaccount_type.go | 100.00% <100.00%> (ø) |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.