-
Notifications
You must be signed in to change notification settings - Fork 179
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
[FVM] beyond EVM part 2.2 - adding EVM emulator #4927
Conversation
fvm/evm/emulator/config.go
Outdated
CanTransfer: core.CanTransfer, | ||
Transfer: core.Transfer, | ||
GasLimit: BlockLevelGasLimit, // block gas limit | ||
BaseFee: big.NewInt(0), // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BaseFee: big.NewInt(0), // | |
BaseFee: big.NewInt(0), |
// check source balance | ||
// if balance is lower than amount return | ||
if proc.state.GetBalance(addr).Cmp(amount) == -1 { | ||
return res, types.ErrInsufficientBalance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be a fatal error for this specific case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why fatal? this means the user didn't have enough balance in it's account to withdraw from.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry missed the cmp method, you are right.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4927 +/- ##
==========================================
- Coverage 55.75% 49.29% -6.47%
==========================================
Files 955 428 -527
Lines 88883 37762 -51121
==========================================
- Hits 49557 18613 -30944
+ Misses 35589 17762 -17827
+ Partials 3737 1387 -2350
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
|
||
// create account if not exist | ||
if !proc.state.Exist(addr) { | ||
proc.state.CreateAccount(addr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed, add a balance call below will create a new object if it doesn't exist. I can understand tho if you wanted to make it super clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think add balance
would create the object if not exist, not the account :-?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left comments but nothing major
The second part of this large PR