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

Updates Fungible Token tutorial to use a different structure and explainations #1238

Merged
merged 8 commits into from
Nov 18, 2021

Conversation

joshuahannan
Copy link
Member

@joshuahannan joshuahannan commented Nov 15, 2021

Closes #1192

Description

  • Updates the fungible token tutorial to explain the basic version of fungible tokens first before adding interfaces and capabilities
  • Adds more clarification about certain topics and warnings about anti-patters
  • Fixes a few sentences in the hello world and nft tutorials

  • Targeted PR against master branch
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@github-actions
Copy link

github-actions bot commented Nov 15, 2021

Cadence Benchstat comparison

This branch with compared with the base branch onflow:master commit 81c63bf
The command go test ./... -run=XXX -bench=. -shuffle=on -count N was used.
Bench tests were run a total of 7 times on each branch.

Results

old.txtnew.txt
time/opdelta
ContractInterfaceFungibleToken-252.5µs ± 5%54.7µs ± 5%+4.33%(p=0.026 n=7+7)
RuntimeResourceDictionaryValues-218.0ms ± 4%18.3ms ± 6%~(p=0.456 n=7+7)
RuntimeStorageWriteCached-2157µs ± 4%190µs ±34%~(p=0.383 n=7+7)
ParseFungibleToken-2511µs ± 3%509µs ± 3%~(p=0.710 n=7+7)
ParseDeploy/byte_array-237.8ms ± 6%37.7ms ± 5%~(p=0.902 n=7+7)
ParseDeploy/decode_hex-21.58ms ± 2%1.59ms ± 1%~(p=0.628 n=7+6)
ParseInfix-226.4µs ± 4%26.2µs ± 2%~(p=0.365 n=7+7)
QualifiedIdentifierCreation/One_level-23.50ns ± 1%3.52ns ± 1%~(p=0.221 n=7+7)
QualifiedIdentifierCreation/Three_levels-2177ns ± 2%179ns ± 3%~(p=0.383 n=7+7)
CheckContractInterfaceFungibleTokenConformance-2194µs ± 6%196µs ± 3%~(p=0.535 n=7+7)
NewInterpreter/new_sub-interpreter-22.35µs ± 2%2.34µs ± 2%~(p=0.598 n=7+7)
InterpretRecursionFib-23.03ms ± 2%3.00ms ± 3%~(p=0.366 n=7+6)
RuntimeFungibleTokenTransfer-21.38ms ± 4%1.34ms ± 1%−2.42%(p=0.008 n=7+6)
NewInterpreter/new_interpreter-21.31µs ± 6%1.26µs ± 1%−3.47%(p=0.001 n=7+6)
ParseArray-225.7ms ± 5%24.6ms ± 1%−4.17%(p=0.017 n=7+7)
 
alloc/opdelta
RuntimeResourceDictionaryValues-24.34MB ± 0%4.34MB ± 0%~(p=0.318 n=7+7)
RuntimeFungibleTokenTransfer-2233kB ± 0%233kB ± 0%~(p=0.737 n=7+7)
RuntimeStorageWriteCached-283.7kB ± 0%83.7kB ± 0%~(p=1.000 n=7+6)
QualifiedIdentifierCreation/One_level-20.00B 0.00B ~(all equal)
QualifiedIdentifierCreation/Three_levels-264.0B ± 0%64.0B ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-266.4kB ± 0%66.4kB ± 0%~(p=0.385 n=7+6)
ContractInterfaceFungibleToken-226.7kB ± 0%26.7kB ± 0%~(all equal)
NewInterpreter/new_interpreter-2680B ± 0%680B ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-21.06kB ± 0%1.06kB ± 0%~(all equal)
InterpretRecursionFib-21.21MB ± 0%1.21MB ± 0%~(p=0.462 n=7+7)
 
allocs/opdelta
RuntimeResourceDictionaryValues-2108k ± 0%108k ± 0%~(p=0.438 n=7+7)
RuntimeFungibleTokenTransfer-24.42k ± 0%4.42k ± 0%~(all equal)
RuntimeStorageWriteCached-21.42k ± 0%1.42k ± 0%~(all equal)
QualifiedIdentifierCreation/One_level-20.00 0.00 ~(all equal)
QualifiedIdentifierCreation/Three_levels-22.00 ± 0%2.00 ± 0%~(all equal)
CheckContractInterfaceFungibleTokenConformance-21.07k ± 0%1.07k ± 0%~(all equal)
ContractInterfaceFungibleToken-2458 ± 0%458 ± 0%~(all equal)
NewInterpreter/new_interpreter-211.0 ± 0%11.0 ± 0%~(all equal)
NewInterpreter/new_sub-interpreter-231.0 ± 0%31.0 ± 0%~(all equal)
InterpretRecursionFib-225.0k ± 0%25.0k ± 0%~(all equal)
 

@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2021

Codecov Report

Merging #1238 (4d2ebda) into master (81c63bf) will not change coverage.
The diff coverage is n/a.

❗ Current head 4d2ebda differs from pull request most recent head 5419634. Consider uploading reports for the commit 5419634 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1238   +/-   ##
=======================================
  Coverage   77.60%   77.60%           
=======================================
  Files         274      274           
  Lines       35233    35233           
=======================================
  Hits        27341    27341           
  Misses       6805     6805           
  Partials     1087     1087           
Flag Coverage Δ
unittests 77.60% <ø> (ø)

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


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 81c63bf...5419634. Read the comment docs.

Copy link
Contributor

@MaxStalker MaxStalker left a comment

Choose a reason for hiding this comment

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

Looking good! :)

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.

Nice!

Copy link
Contributor

@rheaplex rheaplex left a comment

Choose a reason for hiding this comment

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

This is great! I have some suggestions but apart from adding a "to" to a sentence I don't think any are must-changes.

👍👍👍

@joshuahannan
Copy link
Member Author

Thank you everyone for the comments! I really appreciate it. I included almost every suggestion that was made.
@10thfloor I addressed all your comments, so can you approve the PR so I can merge it? Thanks!

@joshuahannan joshuahannan merged commit a4edca6 into master Nov 18, 2021
@joshuahannan joshuahannan deleted the nft-tutorial branch November 18, 2021 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation Improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fungible token code is different between tutorial and playground example
7 participants