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

testing fee values (2x) #101

Merged
merged 1 commit into from
May 30, 2019
Merged

Conversation

igormcoelho
Copy link
Contributor

Just a bunch of tests to enforce overprice calculation of transactions.

@igormcoelho
Copy link
Contributor Author

igormcoelho commented May 30, 2019

Some people are confused with current pricing calculation, so I added five simple tests that demonstrate possible situations.

Examples are:

- LowPriority (network fee = 0.0001,  size = 1024) -> PASS
- LowPriority (network fee = 0.0001,  size = 1025) -> FAIL
- HighPriority (network fee = 0.001,  size = 1024) -> PASS  | oversize in bytes = 0B
- HighPriority (network fee = 0.001,  size = 1025) -> PASS  | oversize in bytes = (1025-1024=1)  *  0.00001  = 0.00001 <= 0.001 (paid network fee)
- HighPriority (network fee = 0.001,  size = 1124) -> PASS  | oversize in bytes = (1124-1024=100)  *  0.00001  = 0.001 <= 0.001 (paid network fee)
- HighPriority (network fee = 0.001,  size = 1125) -> FAIL  | oversize in bytes = (1125-1024=101)  *  0.00001  = 0.00101 > 0.001 (paid network fee is NOT enough)
- HighPriority (network fee = 0.00101,  size = 1125) -> PASS  | oversize in bytes = (1125-1024=101)  *  0.00001  = 0.00101 <= 0.00101 (paid network fee is enough)

Copy link
Member

@vncoelho vncoelho left a comment

Choose a reason for hiding this comment

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

Great job, Brother!

@vncoelho
Copy link
Member

Great examples that will make comprehension quite clear!

@vncoelho vncoelho merged commit 4cf5f46 into neo-project:master-2.x May 30, 2019
@igormcoelho igormcoelho deleted the master-2.x branch May 30, 2019 21:59
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.

3 participants