Skip to content
Snippets Groups Projects
Commit 7cc9286f authored by Krzysztof Leśniak's avatar Krzysztof Leśniak
Browse files

fix get_reward_funds test

Introduced json schema validator.
parent 0c016df6
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
- validator_result_json: &validator_result_json - validator_result_json: &validator_result_json
- json_file_validator: {jsonpath_mini: "result", comparator: "json_compare", expected: {template: '$api/$method'}} - json_file_validator: {jsonpath_mini: "result", comparator: "json_compare", expected: {template: '$api/$method'}}
- validator_schema_json: &validator_schema_json
- json_schema: {schema: {file: {template: '$method.json.schema'}}}
- test: - test:
- name: "get_dynamic_global_properties" - name: "get_dynamic_global_properties"
- variable_binds: - variable_binds:
...@@ -140,6 +143,9 @@ ...@@ -140,6 +143,9 @@
- method: "get_reward_funds" - method: "get_reward_funds"
- args: {} - args: {}
- <<: *base_test - <<: *base_test
- validators:
- <<: *validator_base
- <<: *validator_schema_json
- test: - test:
- name: "get_current_price_feed" - name: "get_current_price_feed"
......
{
"funds": []
}
\ No newline at end of file
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"properties": {
"jsonrpc": {
"type": "string"
},
"result": {
"type": "object",
"properties": {
"funds": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"pattern": "[0-9]*"
},
"name": {
"type": "string"
},
"reward_balance": {
"type": "object",
"properties": {
"amount": {
"type": "string",
"pattern": "[1-9][0-9]*"
},
"precision": {
"type": "integer",
"pattern": "^3$"
},
"nai": {
"type": "string",
"pattern": "^@@000000021$"
}
},
"required": [
"amount",
"nai",
"precision"
]
},
"recent_claims": {
"type": "string",
"pattern": "[1-9][0-9]*"
},
"last_update": {
"type": "string",
"format": "email"
},
"content_constant": {
"type": "string",
"pattern": "[1-9][0-9]*"
},
"percent_curation_rewards": {
"type": "integer",
"pattern": "[1-9][0-9]*"
},
"percent_content_rewards": {
"type": "integer",
"pattern": "[1-9][0-9]*"
},
"author_reward_curve": {
"type": "string"
},
"curation_reward_curve": {
"type": "string"
}
},
"required": [
"author_reward_curve",
"content_constant",
"curation_reward_curve",
"id",
"last_update",
"name",
"percent_content_rewards",
"percent_curation_rewards",
"recent_claims",
"reward_balance"
]
}
}
},
"required": [
"funds"
]
},
"id": {
"type": "integer"
}
},
"required": [
"id",
"jsonrpc",
"result"
]
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment