Skip to content

Commit

Permalink
Merge pull request #140 from KiraCore/release/v0.4.23
Browse files Browse the repository at this point in the history
release/v0.4.23 -> master
  • Loading branch information
asmodat authored Dec 23, 2022
2 parents 2e92b38 + e106e94 commit b312920
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 10 deletions.
3 changes: 1 addition & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Features:
* add integration tests for evm endpoints
* update kira endpoints to be under `kira` network in url
* fix valopers api endpoint issue
2 changes: 1 addition & 1 deletion config/constants.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

const (
InterxVersion = "v0.4.22"
InterxVersion = "v0.4.23"
SekaiVersion = "v0.3.1.25"
CosmosVersion = "v0.45.1"

Expand Down
22 changes: 21 additions & 1 deletion scripts/test-local/Validators/query-validators.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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))"
12 changes: 6 additions & 6 deletions types/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit b312920

Please sign in to comment.