-
Notifications
You must be signed in to change notification settings - Fork 370
fix broken getInclusionStates API call #1685
fix broken getInclusionStates API call #1685
Conversation
@@ -154,7 +154,7 @@ Feature: Test API calls on Machine 1 | |||
|
|||
Then the response for "getInclusionStates" should return with: | |||
|keys |values |type | | |||
|states |False |bool | | |||
|states |True |bool | |
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.
really?
We will wait for @DyrellC to say whether this makes sense and wait for buildkite
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
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.
Btw, @DyrellC, this is what I was talking to you about needing to to properly document the DBs, currently it changed and I have no idea why by just looking at the code.
Besides that, @acha-bill, maybe it is worth while to have another scenario (or step) in this PR for getInclusionStates
. We want to have both the True
and False
cases.
We also want to make sure that we can accept a list of Hashes and not just one single hash.
You can wait for @DyrellC to explain to you what is going on with the DB
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.
@galrogo this instance was actually the db that you had provided in the previous regression tests, but it does highlight this point yes.
@acha-bill since the getInclusionStates
call will no longer need the tip list, you can remove that from the input side of the test. You could also add the list example that @galrogo is asking for with a 2 for 1 by having another scenario that tests inclusion state on a list of randomly generated hashes and having that return a boolList
of false. That would cover testing a list scenario as well as making sure we have false cases register false as well.
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.
@DyrellC The python lib throws expected 3 args
for getInclusionStates
.
So we'll leave the tips
param there for now.
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.
Hmm I am adding communicating with clients to checklist
private AbstractResponse getInclusionStatesStatement( | ||
final List<String> transactions, | ||
final List<String> tips) throws Exception { | ||
private AbstractResponse getInclusionStatesStatement(final List<String> transactions ) throws Exception { |
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.
did you test what happens when someone passes tips still?
(it should work, but just checking)
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.
works. No difference
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.
Just the commentary on the test itself for adding the additional use case, i'll leave it to @galrogo discretion as to whether to add that in this issue or as a future PR.
@@ -154,7 +154,7 @@ Feature: Test API calls on Machine 1 | |||
|
|||
Then the response for "getInclusionStates" should return with: | |||
|keys |values |type | | |||
|states |False |bool | | |||
|states |True |bool | |
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.
@galrogo this instance was actually the db that you had provided in the previous regression tests, but it does highlight this point yes.
@acha-bill since the getInclusionStates
call will no longer need the tip list, you can remove that from the input side of the test. You could also add the list example that @galrogo is asking for with a 2 for 1 by having another scenario that tests inclusion state on a list of randomly generated hashes and having that return a boolList
of false. That would cover testing a list scenario as well as making sure we have false cases register false as well.
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 want to expand the scenario
Let's finish this feature correctly
TEST_TIP_LIST = ["SBKWTQWCFTF9DBZHJKQJKU9LXMZD9BMWJIJLZCCZYJFWIBGYYQBJOWWFWIHDEDTIHUB9PMOWZVCPKV999"] | ||
TEST_HASH_LIST = ["NMPXODIWSCTMWRTQ9AI9VROYNFACWCQDXDSJLNC9HKCECBCGQTBUBKVROXZLQWAZRQUGIJTLTMAMSH999", | ||
"INVALIDWSCTMWRTQ9AI9VROYNFACWCQDXDSJLNC9HKCECBCGQTBUBKVROXZLQWAZRQUGIJTLTMAMSH999"] |
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 suppose the second tx is a made up transaction.
Can we also add a real tx that is not included?
I think the scenarios should include:
- A bundle tail that is approved
- A bundle tail that is not approved
- A non-tail that is approved
- A non-tail that is not apporved
- a made up tx
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.
Dropping scenario 2 and 4 as agreed with @galrogo .
@@ -154,7 +154,18 @@ Feature: Test API calls on Machine 1 | |||
|
|||
Then the response for "getInclusionStates" should return with: | |||
|keys |values |type | | |||
|states |True |bool | | |||
| states | TEST_HASH_RES | staticValue | |
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.
Only in case it is not too much work (no more than 5-10 minutes)
I think that maybe for the responses we can put the actual list in the table instead of the static val.
I just don't like it that we mask what's going on too much.
With long hashes there is less of a choice because they are long and ugly...
If this requires work than just comment on the reply and ignore
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.
You can just use a boolList type here instead of loading a staticValue. Bool list will make an array of bools to compare with. So all you need to do is change the line to:
|states | True | boolList |
see line 113 in python-regression/utils/test_logic/value_fetch_logic.py
|
||
Then the response for "getInclusionStates" should return with: | ||
| keys | values | type | | ||
| states | TEST_RESPONSE | staticValue | |
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.
ditto
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.
see above comment, same thing
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.
@DyrellC add new type boolListMixed
cause boolList
could only convert 1 type.
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.
Lovely 👌
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 now
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.
New scenario addition looks good.
Description
Updates
getInclusionStates
API call to only check the snapshot index of the given transactions.Tips are therefore irrelevant.
Fixes #1350
Type of change
How Has This Been Tested?
Checklist: