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

Trim the whitespaces before/after each line of TEAL code #3128

Merged
merged 2 commits into from
Oct 25, 2021

Conversation

ahangsu
Copy link
Contributor

@ahangsu ahangsu commented Oct 22, 2021

Summary

Trimming the whitespaces before and after each line in TEAL code.

In #2168, white space before #pragma version XXX leads to a failure in inferring the TEAL version. Relaxing assembler rules resolves the issue.

Closes #2168.

@ahangsu ahangsu marked this pull request as ready for review October 22, 2021 18:45
@ahangsu ahangsu requested a review from jannotti October 22, 2021 18:55
@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2021

Codecov Report

Merging #3128 (cd63fca) into master (1e5603c) will decrease coverage by 11.63%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #3128       +/-   ##
===========================================
- Coverage   43.68%   32.04%   -11.64%     
===========================================
  Files         390      388        -2     
  Lines       86681    86664       -17     
===========================================
- Hits        37863    27773    -10090     
- Misses      42801    54762    +11961     
+ Partials     6017     4129     -1888     
Impacted Files Coverage Δ
data/transactions/logic/assembler.go 72.90% <100.00%> (-6.42%) ⬇️
util/condvar/timedwait.go 0.00% <0.00%> (-100.00%) ⬇️
data/transactions/payset.go 0.00% <0.00%> (-100.00%) ⬇️
crypto/merklearray/worker.go 0.00% <0.00%> (-100.00%) ⬇️
crypto/compactcert/structs.go 0.00% <0.00%> (-100.00%) ⬇️
agreement/agreementtest/keyManager.go 0.00% <0.00%> (-100.00%) ⬇️
daemon/algod/api/server/lib/middlewares/auth.go 0.00% <0.00%> (-100.00%) ⬇️
agreement/agreementtest/simulate.go 0.00% <0.00%> (-87.68%) ⬇️
util/metrics/service.go 0.00% <0.00%> (-87.10%) ⬇️
crypto/compactcert/bigfloat.go 0.00% <0.00%> (-87.04%) ⬇️
... and 184 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 1e5603c...cd63fca. Read the comment docs.

@algochoi
Copy link
Contributor

This is nice! It also might be prudent to have a test in assembler_test.go under TestPragmas() to test out if whitespaces are accepted in the unit test.

@algojohnlee algojohnlee merged commit 9c3f403 into master Oct 25, 2021
@algojohnlee algojohnlee deleted the fix/space-before-pragma branch October 25, 2021 16:35
cce pushed a commit to cce/go-algorand that referenced this pull request Oct 28, 2021
Trimming the whitespaces before and after each line in TEAL code.

In algorand#2168, white space before #pragma version XXX leads to a failure in inferring the TEAL version. Relaxing assembler rules resolves the issue.

Closes algorand#2168.
@egieseke egieseke mentioned this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Space before "#pragma version 3" causes TEAL to fail to compile
5 participants