-
Notifications
You must be signed in to change notification settings - Fork 791
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
Add runTx API tests #352
Add runTx API tests #352
Conversation
Thanks, this already looks quite good. Would assume the same behavior as you for the no-cache case, think we have to look closer into that one. |
I had a quick look, and it seems I'd probably use It seems this might be the direction that was intended, as |
Can you comment out the current failing test with some commentary notes that this should pass (in a similar way) and then open a new issue where you describe what you wrote in the comment above? Then we have this cleanly separated and can move on merging this PR. Also, @mattdean-digicatapult should maybe have a comment on this, since he is the current state manager expert and is currently in the process of reworking this. |
4995b73
to
407874e
Compare
@s1na, there is work in progress on this. I've got a do-not-merge PR (#309) that is gradually being broken up and merged which will clean-up all these direct cache writes. There's still an open question as to how we handle the |
Hey @mattdean-digicatapult :) great. I don't know the arguments for keeping |
cb = opts | ||
return cb(new Error('invalid input, opts must be provided')) | ||
} | ||
|
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.
Ok.
if (!tx) { | ||
return cb(new Error('invalid input, tx is required')) | ||
} | ||
|
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.
Ok.
if (opts.populateCache === false) { | ||
return cb() | ||
} | ||
|
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.
Ok.
) | ||
|
||
t.end() | ||
}) |
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.
Nice cases. In addition to all the failure cases, can you add one which actually passes?
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.
Oh sorry, I was thinking the success case is thoroughly covered by the blockchain tests. You're right, there should be a success case.
Just added a simple one.
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.
Yeah, I think it is better to have this explicitly defined rather than have this implicitly tested somewhere else. Thanks for adding!
Signed-off-by: Sina Mahmoodi <[email protected]>
407874e
to
b5c4f97
Compare
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.
Looks good.
This PR is part of the series for adding API test coverage. It:
runTx.js
lib/runTx.js
to add two validation checks. Furthermore it moves the check forpopulateCache
flag to the beginning of function.populateCache
fails. I'm not sure if the test case makes sense. I assumedrunTx
should run even whenpopulateCache
is false, the difference being that no cache is utilized. However,runTx
fails because it tries to use cache nevertheless.createGenesis
utility toutils.js
file.