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

Marketplace tutorial improvements #1412

Merged
merged 4 commits into from
Feb 25, 2022
Merged

Marketplace tutorial improvements #1412

merged 4 commits into from
Feb 25, 2022

Conversation

joshuahannan
Copy link
Member

@joshuahannan joshuahannan commented Feb 11, 2022

Closes onflow/flow#362

Description

Updates the marketplace tutorial to use cadence best practices and the same contracts that are in the ft and nft tutorials

The updated code is in this PR: onflow/flow-playground-tutorials#7

  • Use ExampleToken and ExampleNFT instead of FungibleToken and NonFungibleToken
  • Use correct storage paths
  • Use more parameters in events
  • Use a capability to the nft collection instead of storing nfts directly
  • Add a lot more clarification about capabilities
  • More links to nft storefront

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@joshuahannan joshuahannan added Dev Portal Documentation Documentation Improvements or additions to documentation SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board T-Documentation 📃 labels Feb 11, 2022
@github-actions
Copy link

github-actions bot commented Feb 11, 2022

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 929eabb
The command for i in {1..N}; do go test ./... -run=XXX -bench=. -shuffle=on; done was used.
Bench tests were run a total of 7 times on each branch.

Results

old.txtnew.txt
time/opdelta
ParseInfix-210.1µs ± 3%10.4µs ± 1%+2.89%(p=0.018 n=7+5)
CheckContractInterfaceFungibleTokenConformance-2174µs ± 2%178µs ± 4%+2.62%(p=0.035 n=6+7)
RuntimeFungibleTokenTransfer-21.57ms ±24%1.85ms ± 4%~(p=0.138 n=7+6)
ParseDeploy/decode_hex-21.50ms ± 9%1.44ms ± 3%~(p=0.097 n=7+7)
ParseArray-216.1ms ±13%15.6ms ± 5%~(p=0.535 n=7+7)
ParseFungibleToken-2244µs ± 7%242µs ±11%~(p=0.805 n=7+7)
QualifiedIdentifierCreation/One_level-23.34ns ± 2%3.31ns ± 6%~(p=0.456 n=7+7)
QualifiedIdentifierCreation/Three_levels-2172ns ± 4%170ns ± 4%~(p=0.710 n=7+7)
ContractInterfaceFungibleToken-249.5µs ± 3%51.4µs ± 8%~(p=0.073 n=7+7)
NewInterpreter/new_interpreter-21.30µs ± 4%1.33µs ± 4%~(p=0.138 n=6+7)
NewInterpreter/new_sub-interpreter-22.58µs ± 4%2.69µs ± 7%~(p=0.128 n=7+7)
InterpretRecursionFib-22.90ms ± 9%2.87ms ± 5%~(p=0.902 n=7+7)
RuntimeResourceDictionaryValues-217.7ms ± 5%17.1ms ± 3%−3.16%(p=0.038 n=7+7)
ParseDeploy/byte_array-225.2ms ± 7%23.8ms ± 2%−5.58%(p=0.014 n=7+6)
 
alloc/opdelta
RuntimeFungibleTokenTransfer-2271kB ± 0%271kB ± 0%~(p=0.247 n=7+7)
RuntimeResourceDictionaryValues-24.05MB ± 0%4.05MB ± 0%~(p=1.000 n=7+7)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
ContractInterfaceFungibleToken-226.6kB ± 0%26.6kB ± 0%~(p=0.538 n=6+7)
CheckContractInterfaceFungibleTokenConformance-266.2kB ± 0%66.2kB ± 0%~(all equal)
NewInterpreter/new_interpreter-2768B ± 0%768B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.24kB ± 0%1.24kB ± 0%~(all equal)
InterpretRecursionFib-21.24MB ± 0%1.24MB ± 0%~(p=0.409 n=7+7)
 
allocs/opdelta
RuntimeFungibleTokenTransfer-24.51k ± 0%4.50k ± 0%~(p=0.101 n=7+6)
RuntimeResourceDictionaryValues-2102k ± 0%102k ± 0%~(p=1.000 n=7+7)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
ContractInterfaceFungibleToken-2458 ± 0%458 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
NewInterpreter/new_interpreter-212.0 ± 0%12.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-238.0 ± 0%38.0 ± 0%~(all equal)
InterpretRecursionFib-225.0k ± 0%25.0k ± 0%~(all equal)
 

@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2022

Codecov Report

Merging #1412 (5c16146) into master (929eabb) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1412   +/-   ##
=======================================
  Coverage   72.65%   72.65%           
=======================================
  Files         288      288           
  Lines       39303    39303           
=======================================
+ Hits        28555    28557    +2     
+ Misses       9259     9257    -2     
  Partials     1489     1489           
Flag Coverage Δ
unittests 72.65% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
runtime/interpreter/storage.go 73.10% <0.00%> (+1.68%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 929eabb...5c16146. Read the comment docs.

@joshuahannan
Copy link
Member Author

@SupunS @dsainati1 Any idea why the CI isn't completing here?

@joshuahannan
Copy link
Member Author

@turbolent Can you help me figure out why the lint and test steps aren't completing here? Thanks!

@turbolent
Copy link
Member

@joshuahannan after you opened this PR, another PR changed the names of the CI jobs (e.g test -> Test). The project configuration expects the Lint and Test jobs to succeed, but this PR's CI config in this branch still has the outdated job names (which pass BTW).

TLDR: Merge master back into your branch (git merge master) and push the changes up. That will retrigger CI and have everything pass.

Sorry for the inconvenience, didn't notice before

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't check the code changes in detail, mostly read the new guide text, which looks good 👍 \

@joshuahannan joshuahannan merged commit f3de22f into master Feb 25, 2022
@joshuahannan joshuahannan deleted the marketplace-tutorial branch February 25, 2022 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dev Portal Documentation Documentation Improvements or additions to documentation SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cadence Tutorials - Marketplace
4 participants