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

Feature/transfertoken rm tokenid 0 #1893

Merged
merged 6 commits into from Jan 3, 2019

Conversation

taihaofu
Copy link
Contributor

What does this PR do?

  1. For transfertoken(uint256 amount, trctoken id) native function, remove the id ==0 trx transferring logic. Now it should throw exception.
  2. For transfer token function, value of id should not get overflow long type.
  3. For transfer token function, value of id should be from 1000_000 to Long.max value if transfer a token.
  4. ORIGIN and ADDRESS instruction value safety check.
    Why are these changes required?

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

@codecov-io
Copy link

Codecov Report

Merging #1893 into develop will increase coverage by 0.07%.
The diff coverage is 43.18%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #1893      +/-   ##
=============================================
+ Coverage      46.06%   46.14%   +0.07%     
- Complexity      3964     4010      +46     
=============================================
  Files            473      473              
  Lines          27614    27767     +153     
  Branches        2828     2858      +30     
=============================================
+ Hits           12721    12812      +91     
- Misses         13809    13860      +51     
- Partials        1084     1095      +11
Impacted Files Coverage Δ Complexity Δ
src/main/java/org/tron/common/runtime/vm/VM.java 62.36% <14.28%> (-0.47%) 99 <0> (ø)
...va/org/tron/common/runtime/vm/program/Program.java 48.2% <42.1%> (-0.33%) 116 <3> (+3)
...main/java/org/tron/common/runtime/RuntimeImpl.java 65.44% <44.44%> (-0.51%) 52 <2> (+2)
.../java/org/tron/common/runtime/config/VMConfig.java 68.18% <50%> (-4.05%) 9 <1> (+1)
...n/java/org/tron/common/runtime/vm/MessageCall.java 95.83% <80%> (-4.17%) 11 <3> (ø)
...org/tron/common/overlay/server/ChannelManager.java 66.21% <0%> (-1.36%) 19% <0%> (-1%)
...n/java/org/tron/common/overlay/server/Channel.java 78.5% <0%> (-0.94%) 28% <0%> (-1%)
src/main/java/org/tron/core/db/Manager.java 49.17% <0%> (+0.92%) 146% <0%> (+36%) ⬆️
...ain/java/org/tron/common/utils/ForkController.java 68.47% <0%> (+16.57%) 19% <0%> (+5%) ⬆️

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 7f1cbf7...9a60fa3. Read the comment docs.

@ithinker1991 ithinker1991 self-requested a review January 3, 2019 08:52
Copy link
Contributor

@ithinker1991 ithinker1991 left a comment

Choose a reason for hiding this comment

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

nice commits

@huzhenyuan huzhenyuan merged commit 1043b72 into develop Jan 3, 2019
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.

None yet

5 participants