Skip to content

[Version-unspecific] queryMimirV2IDs: jsonify the map for a deterministic sorted order

Multipartite requested to merge Multi/jsonify-queryMimirV2IDs-map into develop

[Version-unspecific]

Intended to close #1770 (closed)
'queryMimirV2IDs alone has arbitrary order which causes test-regression pipeline job failures'.


Initial commit job failure notes:
Other than the many empty operation warnings,
the order is as intended,
but the response appears in a {} object (like /thorchain/mimir ) rather than a [] array,
and so .[0] produces Cannot index object with number.
The regression test asserts thus may need to be changed to the format .|[.[]][0].id rather than .[0].id .
."1-GLOBAL".id would also pass, but would work regardless of order and so not reflect the fixed order determinism for #1770 (closed)'s resolution.

12:28PM INF cmd/run.go:35 > Running regression test: suites/mimir/mimir_v2.yaml
12:28PM WRN cmd/run.go:172 > empty operation, line numbers may be wrong
12:28PM WRN cmd/run.go:172 > empty operation, line numbers may be wrong
12:28PM WRN cmd/run.go:172 > empty operation, line numbers may be wrong
12:28PM WRN cmd/run.go:172 > empty operation, line numbers may be wrong
12:28PM WRN cmd/run.go:172 > empty operation, line numbers may be wrong
12:28PM WRN cmd/run.go:172 > empty operation, line numbers may be wrong
12:28PM INF cmd/run.go:205 > >>> [1] state line=0
12:28PM INF cmd/run.go:306 > Executing 26 operations
12:28PM INF cmd/run.go:308 > >>> [2] create-blocks line=3
12:28PM INF cmd/run.go:308 > >>> [3] tx-mimir line=6
12:28PM INF cmd/run.go:308 > >>> [4] check line=12
12:28PM INF cmd/run.go:308 > >>> [5] tx-mimir line=17
12:28PM INF cmd/run.go:308 > >>> [6] tx-mimir line=21
12:28PM INF cmd/run.go:308 > >>> [7] tx-mimir line=26
12:28PM INF cmd/run.go:308 > >>> [8] create-blocks line=31
12:28PM INF cmd/run.go:308 > >>> [9] check line=36
12:28PM INF cmd/run.go:308 > >>> [10] check line=39
12:28PM INF cmd/run.go:308 > >>> [11] check line=44
12:28PM INF cmd/run.go:308 > >>> [12] tx-mimir line=49
12:28PM INF cmd/run.go:308 > >>> [13] create-blocks line=59
12:28PM INF cmd/run.go:308 > >>> [14] check line=62
12:28PM INF cmd/run.go:308 > >>> [15] check line=67
12:28PM INF cmd/run.go:308 > >>> [16] tx-mimir line=70
12:28PM INF cmd/run.go:308 > >>> [17] create-blocks line=75
12:28PM INF cmd/run.go:308 > >>> [18] check line=80
Operation:
type: check
endpoint: http://localhost:1317/thorchain/mimirV2/ids
params: {}
status: 200
asserts:
    - .[0].id == 1
    - .[0].name == "AFFILIATEFEEBASISPOINTSMAXGLOBAL"
    - .[0].legacy_key == "MAXAFFILIATEFEEBASISPOINTS"
    - .[0].vote_key == "1-GLOBAL"
    - .[0].type == "Economic"
    - .[0].votes."500" == 4
    - .[1].id == 2
    - .[1].name == "BONDPAUSEGLOBAL"
    - .[1].legacy_key == "PAUSEBOND"
    - .[1].vote_key == "2-GLOBAL"
    - .[1].type == "Operational"
    - .[1].votes."1" == 1
Failed Assert: .[0].id == 1
Endpoint Response:
{
  "1-GLOBAL": {
    "id": 1,
    "name": "AFFILIATEFEEBASISPOINTSMAXGLOBAL",
    "vote_key": "1-GLOBAL",
    "legacy_key": "MAXAFFILIATEFEEBASISPOINTS",
    "type": "Economic",
    "votes": {
      "500": 4
    }
  },
  "2-GLOBAL": {
    "id": 2,
    "name": "BONDPAUSEGLOBAL",
    "vote_key": "2-GLOBAL",
    "legacy_key": "PAUSEBOND",
    "type": "Operational",
    "votes": {
      "1": 1
    }
  }
}
jq: error (at <stdin>:21): Cannot index object with number
Edited by Multipartite

Merge request reports