Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Functional test tx type 3 - Subtask #678 - Close #835 #882

Merged
merged 5 commits into from
Oct 20, 2017

Conversation

diego-G
Copy link

@diego-G diego-G commented Oct 19, 2017

Subtask #678
Close #835

var accountMinimalFunds = node.randomAccount();
var accountDuplicate = node.randomAccount();

var account33 = node.randomAccount();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it some better name for account33?

})
.then(function (res) {
var promisesCredits33 = [];
for (var i = 0; i < 33; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to name the variables instead of using magic numbers.
var MAX_VOTES_IN_ONE_TRANSACTION = 33;

var transaction;

before(function () {
// Crediting accounts and registering delegates
Copy link
Contributor

Choose a reason for hiding this comment

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

I would appreciate a better description - why all the steps below are needed. The scenario descriptions.


describe('transactions processing', function () {

it('upvoting with manipulated vote should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

with "++" preset

});
});

it('downvoting with manipulated vote should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

with "--"

});
});

it('upvoting 33 delegates at once should be ok', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

33 (maximum amount)

});
});

it('upvoting 101 delegates separately should be ok', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is upvoting 102 delegates done in the different place?

});
});

it('upvoting 34 delegates at once should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

34 (1 extra)

});
});

it('self downvoting should be ok', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing self downvoting twice should fail?

goodTransactions.push(transaction);
});
});

Copy link
Contributor

Choose a reason for hiding this comment

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

Why is downvoting done in a different place?

Copy link
Author

Choose a reason for hiding this comment

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

Because It performs the downvoting over the same fresh accounts just voted in the prior phase.

- Better variable naming
- Add comments
- Improve descriptions
- Get constants from core
- Add new test for unconfirmed states
- Review arrays of enforcement transactions
@diego-G diego-G force-pushed the 835-functional_test_type_3 branch from 03befea to 1e65dcd Compare October 19, 2017 15:53
Copy link
Contributor

@MaciejBaj MaciejBaj left a comment

Choose a reason for hiding this comment

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

Good job, few issues mentioned in comments, in addition to that:

  • you are testing upvoting with '++', but not downvoting with '--'
  • ss I mentioned the last time - would be really nice if above the before the section you will write the scenario of those tests as the process is complex


describe('transactions processing', function () {

it('voting with invalid vote format should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

voting with "++" operator should fail

});
});

it('voting with invalid vote length should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

so the test is about voting with invalid length - don't include the special "--" operator here

});
});

it('using invalid vote operator \'x\' should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

"x"

@diego-G diego-G dismissed MaciejBaj’s stale review October 20, 2017 11:17

Thanks for insisting. Also it improves promises code format

@diego-G diego-G requested a review from MaciejBaj October 20, 2017 11:18
In this case, we create as many delegates as the network allows to be active. This parameter
is directly related to the maximum number of allowed votes per account. Another independent
account is credited and performs tests uniquely to delegates from this scenario.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed typos:
Creating two scenarios with two isolated set of accounts

  • First scenario --> MaxVotesPerTransaction
    We register the exact amount of delegates the networks allows to be voted per transaction.
    A new fresh account is credited to perform the voting tests to those delegates.

  • Second scenario --> MaxVotesPerAccount
    In this case, we create as many delegates as the network allows to be active. This parameter
    is directly related to the maximum number of allowed votes per account. Another independent
    account is credited and performs tests uniquely to delegates from this scenario.

@diego-G diego-G force-pushed the 835-functional_test_type_3 branch from bfaa5eb to 871aea9 Compare October 20, 2017 11:26
MaciejBaj
MaciejBaj previously approved these changes Oct 20, 2017

describe('unconfirmed state', function () {

it('upvoting with valid params and duplicate submission should be ok but just first transaction to arrive will be confirmed', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

test and its description are opposite,

MaciejBaj
MaciejBaj previously approved these changes Oct 20, 2017
SargeKhan
SargeKhan previously approved these changes Oct 20, 2017
MaciejBaj
MaciejBaj previously approved these changes Oct 20, 2017
Copy link
Contributor

@Isabello Isabello left a comment

Choose a reason for hiding this comment

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

Fix these descriptions, please.

});
});

it('using invalid vote operator "x" should fail', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not use double quotes in descriptions? feels wrong.

Copy link
Author

Choose a reason for hiding this comment

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

Ignored


describe('unconfirmed state', function () {

it('upvoting with valid params and duplicate submission should be ok but just last transaction to arrive will be confirmed', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

this description needs some help.


describe('unconfirmed state after validation', function () {

it('downvoting with valid params and duplicate submission should be ok but just last transaction to arrive will be confirmed', function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

what?

@diego-G diego-G dismissed stale reviews from MaciejBaj and SargeKhan via 6c5ad3f October 20, 2017 14:09
@Isabello Isabello merged commit c0d2637 into 1.0.0 Oct 20, 2017
@Isabello Isabello deleted the 835-functional_test_type_3 branch October 20, 2017 14:56
@diego-G diego-G restored the 835-functional_test_type_3 branch October 20, 2017 15:50
shuse2 added a commit that referenced this pull request Apr 15, 2019
Add transfer transaction class - Closes #882
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants