-
Notifications
You must be signed in to change notification settings - Fork 8
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
New messages for pull rumors #1877
Merged
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
6b8aa1d
added new message
DanielTavaresA 99d3060
change to pattern
DanielTavaresA f088ad6
prettier
DanielTavaresA da6c0d9
added examples
DanielTavaresA e8a97ae
fix test
DanielTavaresA 925bb61
add documentation
DanielTavaresA 0585971
changed rumor_state to state
DanielTavaresA 573f46e
added rumor_state_ans to answer
DanielTavaresA b1955aa
corrected answer to match new array
DanielTavaresA 6b9d732
updated protocol
DanielTavaresA 8bbdb5d
Merge branch 'master' into work-protocol-pull-rumor
DanielTavaresA 3dbed66
added rumor_state to query schema
DanielTavaresA 08c5438
fix typo
DanielTavaresA e5b9a22
added rumor objects
DanielTavaresA 4a2ac3b
lint fix
DanielTavaresA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"method": "rumor_state", | ||
"params": { | ||
"rumor_state": { | ||
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3, | ||
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5, | ||
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1, | ||
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10 | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
protocol/examples/query/rumor_state/wrong_rumor_state_additionnal_params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"method": "rumor_state", | ||
"params": { | ||
"rumor_state": { | ||
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3, | ||
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5, | ||
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1, | ||
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10 | ||
}, | ||
"additionalParams": "" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
protocol/examples/query/rumor_state/wrong_rumor_state_negative_rumor_id.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"method": "rumor_state", | ||
"params": { | ||
"rumor_state": { | ||
"J9fBzJV70Jk5c-i3277Uq4CmeL4t53WDfUghaK0HpeM=": 3, | ||
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5, | ||
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1, | ||
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": -10 | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
protocol/examples/query/rumor_state/wrong_rumor_state_wrong_key.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 4, | ||
"method": "rumor_state", | ||
"params": { | ||
"rumor_state": { | ||
"notInBase64": 3, | ||
"RZOPi59Iy5gkpS2mkpfQJNl44HKc2jVbF0iTGm0RvfU=": 5, | ||
"CfG2ByLhtLJH--T2BL9hZ6eGm11tpkE-5KuvysSCY0I=": 1, | ||
"r8cG9HyJ1FGBke_5IblCdH19mvy39MvLFSArVmY3FpY=": 10 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://raw.githubusercontent.com/dedis/popstellar/master/protocol/query/method/object/rumor_state.json", | ||
"title": "State of received rumors", | ||
"description": "An object containing key-value pairs where each key is a server public key and each value is the last rumor_id it received from this server", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^(?:[a-zA-Z0-9-_]{4})*(?:|[a-zA-Z0-9-_]{3}=|[a-zA-Z0-9+-_]{2}==|[a-zA-Z0-9+-_]===)$": { | ||
"description": "[Integer] ID of the rumor", | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://raw.githubusercontent.com/dedis/popstellar/master/protocol/query/method/rumor_state.json", | ||
"description": "Match sharing state of last rumor seen per sender", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"method": { | ||
"description": "[String] operation to be performed by the query", | ||
"const": "rumor_state" | ||
}, | ||
|
||
"params": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"rumor_state": { | ||
"$ref": "object/rumor_state.json" | ||
} | ||
}, | ||
"required": ["rumor_state"] | ||
}, | ||
|
||
"jsonrpc": { | ||
"$comment": "Defined by the parent, but needed here for the validation" | ||
}, | ||
|
||
"id": { | ||
"type": "integer" | ||
} | ||
}, | ||
|
||
"required": ["method", "params", "id", "jsonrpc"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,9 @@ | |
}, | ||
{ | ||
"$ref": "method/rumor.json" | ||
}, | ||
{ | ||
"$ref": "method/rumor_state.json" | ||
} | ||
], | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 could just write state, we already know it is a rumor_state with the method