---
- config:
  - testset: "Account History API Tests"
  - api: &api "account_history_api"
  - variable_binds:
    - api: *api
  - generators:
    - test_id: {type: 'number_sequence', start: 1}

- base_test: &base_test
  - generator_binds:
    - test_id: test_id
  - group: *api
  - url: "/rpc"
  - method: "POST"
  - body: {template: {file: "request_template.json"}}
  - validators:
    - extract_test: {jsonpath_mini: "error", test: "not_exists"}
    - extract_test: {jsonpath_mini: "result", test: "exists"}
    - compare: {jsonpath_mini: "id", comparator: "str_eq", expected: {template: $test_id}}
    - json_file_validator: {jsonpath_mini: "result", comparator: "json_compare", expected: {template: '$api/$method'}}

- test:
  - name: "get_ops_in_block"
  - variable_binds:
    - method: "get_ops_in_block"
    - args: '{ "block_num": 1000000, "only_virtual": false }'
  - <<: *base_test

# Test disabled due to inaccessible nodes built with SKIP_BY_TX_ID symbol undefined.
#- test:
#  - name: "get_transaction"
#  - variable_binds:
#    - method: "get_transaction"
#    - args: '{ "id": 1000000 }'
#  - <<: *base_test

- test:
  - name: "get_account_history"
  - variable_binds:
    - method: "get_account_history"
    - args: '{ "account": "blocktrades", "start": 100000, "limit": 10 }'
  - <<: *base_test
