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

[Flow EVM] update stdlib balance to use UInt instead of UFix64 #5303

Merged

Conversation

ramtinms
Copy link
Contributor

closes #4961

@ramtinms ramtinms marked this pull request as ready for review January 26, 2024 06:20
@ramtinms ramtinms requested review from turbolent and sideninja and removed request for janezpodhostnik January 26, 2024 06:20
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2024

Codecov Report

Attention: 14 lines in your changes are missing coverage. Please review.

Comparison is base (c665488) 55.70% compared to head (56ac254) 55.68%.

Files Patch % Lines
fvm/evm/stdlib/contract.go 72.00% 11 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5303      +/-   ##
==========================================
- Coverage   55.70%   55.68%   -0.03%     
==========================================
  Files        1002     1002              
  Lines       96879    96914      +35     
==========================================
- Hits        53971    53968       -3     
- Misses      38849    38880      +31     
- Partials     4059     4066       +7     
Flag Coverage Δ
unittests 55.68% <72.00%> (-0.03%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@turbolent
Copy link
Member

Maybe consider using UInt if negative balances should be prevented automatically

@ramtinms ramtinms changed the title [Flow EVM] update stdlib balance to use Int instead of UFix64 [Flow EVM] update stdlib balance to use UInt instead of UFix64 Jan 26, 2024
/// that is used to store account balances inside EVM
/// similar to the way WEI is used to store ETH divisible to 18 decimal places.
access(all)
var attoflow: UInt
Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking if you intentionally name it atttoflow not attoFLOW because it's a new name for metric?

fvm/evm/evm_test.go Show resolved Hide resolved
@ramtinms ramtinms enabled auto-merge February 1, 2024 17:35
@ramtinms ramtinms added this pull request to the merge queue Feb 1, 2024
Merged via the queue into master with commit 443ba43 Feb 1, 2024
50 of 51 checks passed
@ramtinms ramtinms deleted the ramtin/4961-evm-update-balance-in-cadence-smart-contract branch February 1, 2024 18:07
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.

[Flow EVM] adding toAttoFlow method to EVM.Balance
5 participants