Skip to content

Commit

Permalink
feat: include upgrade into integration test and swagger
Browse files Browse the repository at this point in the history
  • Loading branch information
emidev98 committed Sep 7, 2023
1 parent 477d061 commit 20d00e8
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tools/bin/*
examples/build/*
docs/_build
tools-stamp

tmp-swagger-gen
# Data - ideally these don't exist
examples/basecoin/app/data
baseapp/data/*
Expand Down
23 changes: 16 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,8 @@ integration-test-all: init-test-framework \
test-ibc-hooks \
test-vesting-accounts \
test-alliance \
test-tokenfactory
-@rm -rf ./data
-@killall terrad 2>/dev/null
-@killall rly 2>/dev/null
test-tokenfactory \
test-chain-upgrade

init-test-framework: clean-testing-data install
@echo "Initializing both blockchains..."
Expand Down Expand Up @@ -240,11 +238,20 @@ test-tokenfactory:
@echo "Testing tokenfactory..."
./scripts/tests/tokenfactory/tokenfactory.sh

test-chain-upgrade:
@echo "Testing software upgrade..."
bash ./scripts/tests/chain-upgrade/chain-upgrade.sh
clean-testing-data

clean-testing-data:
@echo "Killing terrad and removing previous data"
-@killall terrad 2>/dev/null
-@killall rly 2>/dev/null
-@pkill terrad 2>/dev/null
-@pkill rly 2>/dev/null
-@pkill terrad_new 2>/dev/null
-@pkill terrad_old 2>/dev/null
-@rm -rf ./data
-@rm -rf ./_build


.PHONY: integration-test-all init-test-framework test-relayer test-ica test-ibc-hooks test-vesting-accounts test-tokenfactory clean-testing-data

Expand Down Expand Up @@ -273,7 +280,9 @@ update-swagger-docs: statik

apply-swagger: gen-swagger update-swagger-docs

.PHONY: proto-gen gen-swagger update-swagger-docs apply-swagger
proto-all: proto-gen gen-swagger update-swagger-docs apply-swagger

.PHONY: proto-gen gen-swagger update-swagger-docs apply-swagger proto-all

########################################
### Tools & dependencies
Expand Down
3 changes: 1 addition & 2 deletions client/docs/config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"swagger": "2.0",
"info": {
"title": "Terra Core Rest API",
"description": "Rest Interface for Terra Core v2.5 https://github.com/terra-money/core",
"description": "Source code for <a target='_blank' href='https://github.com/terra-money/core'>Terra Core v2.5</a><br/>UI to interact with the blockchain <a target='_blank' href='https://station.terra.money/'>Station</a><br/>Create a DAO on Terra using <a target='_blank' href='https://enterprise.money/'>Enterprise</a><br/>Run on-chain automted jobs <a target='_blank' href='https://warp.money/'>Wrap</a><br/>Explore the network using <a target='_blank' href='https://terrasco.pe/'>TerraScope</a><br/>Anything you need to know about shared security on <a target='_blank' href='https://alliance.terra.money/'>Alliance Docs</a><br/>More info about the protocol on <a target='_blank' href='https://docs.terra.money/'>Terra Docs</a>",
"version": "2.5"
},
"apis": [
Expand Down
2 changes: 1 addition & 1 deletion client/docs/statik/statik.go

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions client/docs/swagger-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,29 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
<title>Terra Blockchain Swagger UI</title>
<link rel="stylesheet" type="text/css" href="swagger-ui.css" >
<link rel="stylesheet" type="text/css" href="swagger-ui-dark.css" >
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
<style>
html
{
html {
box-sizing: border-box;
overflow: -moz-scrollbars-vertical;
overflow-y: scroll;
}

*,
*:before,
*:after
{
*, *:before, *:after {
box-sizing: inherit;
}

.info hgroup.main{
display: none;
}

.information-container .info {
margin: 0;
}
</style>
</head>

Expand Down
6 changes: 3 additions & 3 deletions client/docs/swagger-ui/swagger-ui-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,8 @@
.swagger-ui .topbar .download-url-wrapper .select-label { color: #f0f0f0; }

.swagger-ui .topbar .download-url-wrapper .download-url-button {
background: #63a040;
color: #fff;
background: #2a69a7;
color: #b5bac9;
}

.swagger-ui .info .title small { background: #7c8492; }
Expand Down Expand Up @@ -783,7 +783,7 @@

.swagger-ui .auth-container, .swagger-ui .dialog-ux .modal-ux-header { border-bottom: 1px solid #2e2e2e; }

.swagger-ui .topbar .download-url-wrapper .select-label select, .swagger-ui .topbar .download-url-wrapper input[type=text] { border: 2px solid #63a040; }
.swagger-ui .topbar .download-url-wrapper .select-label select, .swagger-ui .topbar .download-url-wrapper input[type=text] { border: 2px solid #2a69a7; }

.swagger-ui .info a, .swagger-ui .info a:hover, .swagger-ui .scopes h2 a { color: #99bde6; }

Expand Down
2 changes: 1 addition & 1 deletion client/docs/swagger-ui/swagger-ui-standalone-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9077,7 +9077,7 @@
width: "30",
src: f.default,
alt: "Swagger UI"
}), c.default.createElement("span", null, "swagger")), c.default.createElement("form", {
}), c.default.createElement("span", null, "Terra Blockchain")), c.default.createElement("form", {
className: "download-url-wrapper",
onSubmit: h
}, p.map(function(t, e) {
Expand Down
16 changes: 14 additions & 2 deletions client/docs/swagger-ui/swagger.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
swagger: '2.0'
info:
title: Terra Core Rest API
description: Rest Interface for Terra Core v2.5 https://github.com/terra-money/core
description: >-
Source code for <a target='_blank'
href='https://github.com/terra-money/core'>Terra Core v2.5</a><br/>UI to
interact with the blockchain <a target='_blank'
href='https://station.terra.money/'>Station</a><br/>Create a DAO on Terra
using <a target='_blank'
href='https://enterprise.money/'>Enterprise</a><br/>Run on-chain automted
jobs <a target='_blank' href='https://warp.money/'>Wrap</a><br/>Explore the
network using <a target='_blank'
href='https://terrasco.pe/'>TerraScope</a><br/>Anything you need to know
about shared security on <a target='_blank'
href='https://alliance.terra.money/'>Alliance Docs</a><br/>More info about
the protocol on <a target='_blank' href='https://docs.terra.money/'>Terra
Docs</a>
version: '2.5'
paths:
/terra/alliances:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
OLD_VERSION=feat/mod/ver
UPGRADE_HEIGHT=30
CHAIN_ID=pisco-1
CHAIN_HOME=_build/.testnet
ROOT=$(pwd)
CHAIN_HOME=$ROOT/_build/.testnet
DENOM=uluna
SOFTWARE_UPGRADE_NAME="v2.5"
GOV_PERIOD="10s"

VAL_MNEMONIC_1="clock post desk civil pottery foster expand merit dash seminar song memory figure uniform spice circle try happy obvious trash crime hybrid hood cushion"
WALLET_MNEMONIC_1="banner spread envelope side kite person disagree path silver will brother under couch edit food venture squirrel civil budget number acquire point work mass"

export OLD_BINARY=_build/terrad_old
export NEW_BINARY=_build/terrad_new
export OLD_BINARY=$ROOT/_build/terrad_old
export NEW_BINARY=$ROOT/_build/terrad_new

rm -rf /tmp/terra
rm -r _build
mkdir _build
rm -r $ROOT/_build
mkdir $ROOT/_build

# install old binary
if ! command -v $OLD_BINARY &> /dev/null
Expand All @@ -36,10 +36,9 @@ fi
if ! command -v $NEW_BINARY &> /dev/null
then
make build
cp build/terrad _build/terrad_new
cp build/terrad $ROOT/_build/terrad_new
fi

rm -rf $CHAIN_HOME
# init genesis
$OLD_BINARY init test --home $CHAIN_HOME --chain-id=$CHAIN_ID
echo $VAL_MNEMONIC_1 | $OLD_BINARY keys add val1 --home $CHAIN_HOME --recover --keyring-backend=test
Expand Down Expand Up @@ -90,10 +89,10 @@ echo '{
"deposit": "550000000'$DENOM'",
"title": "Upgrade to '$SOFTWARE_UPGRADE_NAME'",
"summary": "Source Code Version https://github.com/terra-money/core"
}' > _build/software-upgrade.json
}' > $PWD/_build/software-upgrade.json

#
$OLD_BINARY tx gov submit-proposal _build/software-upgrade.json --from val1 --keyring-backend test --chain-id $CHAIN_ID --home $CHAIN_HOME -y
$OLD_BINARY tx gov submit-proposal $ROOT/_build/software-upgrade.json --from val1 --keyring-backend test --chain-id $CHAIN_ID --home $CHAIN_HOME -y
sleep 2
$OLD_BINARY tx gov vote 1 yes --from val1 --keyring-backend test --chain-id $CHAIN_ID --home $CHAIN_HOME -y
#
Expand Down

0 comments on commit 20d00e8

Please sign in to comment.