-
Notifications
You must be signed in to change notification settings - Fork 9
Added query_global_state rpc call #13
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
Conversation
Signed-off-by: Roman Bylbas <romka.bulbas@gmail.com>
| { | ||
| return array( | ||
| 'node_id' => BlockHeaderSerializer::toJson($globalState->getBlockHeader()), | ||
| 'address' => StoredValueSerializer::toJson($globalState->getStoredValue()), |
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.
The keys seem to be invalid
ihor
left a comment
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.
@RomanovSci please check my comments
Signed-off-by: Roman Bylbas <romka.bulbas@gmail.com>
ihor
left a comment
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.
@RomanovSci please have a look at my comment
src/Rpc/RpcClient.php
Outdated
| /** | ||
| * @throws RpcError | ||
| */ | ||
| public function getGlobalState(string $blockHash, string $key, array $path = []): GlobalState |
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.
Let's rename to getGlobalStateByBlock and add another one getGlobalStateByStateRootHash
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.
In Python SDK they added an abstraction called GlobalStateID:
- https://github.com/casper-network/casper-python-sdk/blob/bb11fa2fa708d17016562152596c71aa4fca9adc/pycspr/types/identifiers.py#L24
- https://github.com/casper-network/casper-python-sdk/blob/bb11fa2fa708d17016562152596c71aa4fca9adc/pycspr/api/client.py#L462
However, with only two possible values, having two separate methods will provide a simpler API for consumers
Signed-off-by: Roman Bylbas <romka.bulbas@gmail.com>
Signed-off-by: Roman Bylbas romka.bulbas@gmail.com
Checklist