diff --git a/RELEASE.md b/RELEASE.md index b788c33..31f4052 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,3 @@ Features: -* add integration tests for evm endpoints -* update kira endpoints to be under `kira` network in url \ No newline at end of file +* fix valopers api endpoint issue \ No newline at end of file diff --git a/config/constants.go b/config/constants.go index 3006c19..d6143f6 100755 --- a/config/constants.go +++ b/config/constants.go @@ -1,7 +1,7 @@ package config const ( - InterxVersion = "v0.4.22" + InterxVersion = "v0.4.23" SekaiVersion = "v0.3.1.25" CosmosVersion = "v0.45.1" diff --git a/scripts/test-local/Validators/query-validators.sh b/scripts/test-local/Validators/query-validators.sh index 6b9621a..a4a901d 100755 --- a/scripts/test-local/Validators/query-validators.sh +++ b/scripts/test-local/Validators/query-validators.sh @@ -10,10 +10,30 @@ echoInfo "INFO: $TEST_NAME - Integration Test - START" VALIDATOR_ADDRESS=$(showAddress validator) RESULT_NUM=$(sekaid query customstaking validators --moniker="" --output=json | jq '.validators | length' 2> /dev/null || exit 1) +SIGNING_INFO_SEKAI=$(sekaid query customslashing signing-infos --output=json | jq '.info[0]' 2> /dev/null || exit 1) +START_HEIGHT_SEKAI=$(echo $SIGNING_INFO_SEKAI | jq '.start_height' | tr -d '"') +MISCHANCE_CONFIDENCE_SEKAI=$(echo $SIGNING_INFO_SEKAI | jq '.mischance_confidence' | tr -d '"') +LAST_PRESENT_BLOCK_SEKAI=$(echo $SIGNING_INFO_SEKAI | jq '.last_present_block' | tr -d '"') +MISSED_BLOCKS_COUNTER_SEKAI=$(echo $SIGNING_INFO_SEKAI | jq '.missed_blocks_counter' | tr -d '"') +PRODUCED_BLOCKS_COUNTER_SEKAI=$(echo $SIGNING_INFO_SEKAI | jq '.produced_blocks_counter' | tr -d '"') INTERX_GATEWAY="127.0.0.1:11000" -RESULT_FROM_INTERX_NUM=$(curl --fail $INTERX_GATEWAY/api/valopers | jq '.validators | length' || exit 1) +RESULT_FROM_INTERX=$(curl --fail $INTERX_GATEWAY/api/valopers | jq '.validators' || exit 1) +RESULT_FROM_INTERX_NUM=${#RESULT_FROM_INTERX[@]} +SIGNING_INFO_INTERX=$(echo $RESULT_FROM_INTERX | jq '.[0]' 2> /dev/null || exit 1) +START_HEIGHT_INTERX=$(echo $SIGNING_INFO_INTERX | jq '.start_height' | tr -d '"') +MISCHANCE_CONFIDENCE_INTERX=$(echo $SIGNING_INFO_INTERX | jq '.mischance_confidence' | tr -d '"') +LAST_PRESENT_BLOCK_INTERX=$(echo $SIGNING_INFO_INTERX | jq '.last_present_block' | tr -d '"') +MISSED_BLOCKS_COUNTER_INTERX=$(echo $SIGNING_INFO_INTERX | jq '.missed_blocks_counter' | tr -d '"') +PRODUCED_BLOCKS_COUNTER_INTERX=$(echo $SIGNING_INFO_INTERX | jq '.produced_blocks_counter' | tr -d '"') [ $RESULT_NUM != $RESULT_FROM_INTERX_NUM ] && echoErr "ERROR: Expected validator amount to be '$RESULT_NUM', but got '$RESULT_FROM_INTERX_NUM'" && exit 1 +if [ $RESULT_NUM -ge 1 ] ; then + [ $START_HEIGHT_SEKAI != $START_HEIGHT_INTERX ] && echoErr "ERROR: Expected start height to be '$START_HEIGHT_SEKAI', but got '$START_HEIGHT_INTERX'" && exit 1 + [ $MISCHANCE_CONFIDENCE_SEKAI != $MISCHANCE_CONFIDENCE_INTERX ] && echoErr "ERROR: Expected mischance confidence to be '$MISCHANCE_CONFIDENCE_SEKAI', but got '$MISCHANCE_CONFIDENCE_INTERX'" && exit 1 + [ $LAST_PRESENT_BLOCK_SEKAI -ge 1 ] && [ $LAST_PRESENT_BLOCK_INTERX == 0 ] && echoErr "ERROR: Expected last present block to be '$LAST_PRESENT_BLOCK_SEKAI', but got '$LAST_PRESENT_BLOCK_INTERX'" && exit 1 + [ $MISSED_BLOCKS_COUNTER_SEKAI != $MISSED_BLOCKS_COUNTER_INTERX ] && echoErr "ERROR: Expected missed blocks counter to be '$MISSED_BLOCKS_COUNTER_SEKAI', but got '$MISSED_BLOCKS_COUNTER_INTERX'" && exit 1 + [ $PRODUCED_BLOCKS_COUNTER_SEKAI -ge 1] && [ $PRODUCED_BLOCKS_COUNTER_INTERX == 0 ] && echoErr "ERROR: Expected produced blocks counter to be '$PRODUCED_BLOCKS_COUNTER_SEKAI', but got '$PRODUCED_BLOCKS_COUNTER_INTERX'" && exit 1 +fi echoInfo "INFO: $TEST_NAME - Integration Test - END, elapsed: $(prettyTime $(timerSpan $TEST_NAME))" \ No newline at end of file diff --git a/types/main.go b/types/main.go index 59c1d64..3984a9f 100644 --- a/types/main.go +++ b/types/main.go @@ -264,13 +264,13 @@ type AllValidators struct { type ValidatorSigningInfo struct { Address string `json:"address"` - StartHeight int64 `json:"start_height,string"` - InactiveUntil string `json:"inactive_until"` - MischanceConfidence int64 `json:"mischance_confidence,string"` + StartHeight int64 `json:"startHeight,string"` + InactiveUntil string `json:"inactiveUntil"` + MischanceConfidence int64 `json:"mischanceConfidence,string"` Mischance int64 `json:"mischance,string"` - LastPresentBlock int64 `json:"last_present_block,string"` - MissedBlocksCounter int64 `json:"missed_blocks_counter,string"` - ProducedBlocksCounter int64 `json:"produced_blocks_counter,string"` + LastPresentBlock int64 `json:"lastPresentBlock,string"` + MissedBlocksCounter int64 `json:"missedBlocksCounter,string"` + ProducedBlocksCounter int64 `json:"producedBlocksCounter,string"` } const (