Skip to content

Commit

Permalink
Merge branch 'develop' into docs-update
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev authored Aug 6, 2023
2 parents 410a0fe + b77c02f commit 2c99443
Show file tree
Hide file tree
Showing 56 changed files with 184 additions and 279 deletions.
92 changes: 75 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,62 @@ env:
GITHUB_REF_NAME: "$(echo ${{ github.ref_name }} | tr '//' '-')"

jobs:
build-and-test:
build-and-test-single-arch:
runs-on: ubuntu-latest
timeout-minutes: 20
if: (! startsWith(github.ref, 'refs/tags/')) || (! startsWith(github.ref, 'refs/heads/develop') )
steps:
- uses: actions/checkout@v3

- name: Set CPU Architecture
shell: bash
run: |
if [ "$(uname -m)" == "aarch64" ]; then
echo "CPU_ARCH=arm64" >> $GITHUB_ENV
elif [ "$(uname -m)" == "x86_64" ]; then
echo "CPU_ARCH=amd64" >> $GITHUB_ENV
else
echo "Unsupported architecture" >&2
exit 1
fi
- name: Install Pipeline Dependencies
uses: ./.github/actions/install-dependencies
timeout-minutes: 8
with:
cpu_architecture: ${{ env.CPU_ARCH }}
skip_python: "true"
skip_aws_cli: "true"
skip_docker_compose: "true"

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Test
run: |
echo "Running Build Tests"
make clean
make test
- name: Build zetacored and zetaclientd
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: ${{ env.CPU_ARCH }}
run: |
make install-testnet
cp "$HOME"/go/bin/* ./
chmod a+x ./zetacored
./zetacored version
- name: Clean Up Workspace
if: always()
shell: bash
run: rm -rf *

build-and-test-multi-arch:
strategy:
matrix:
runs-on:
Expand All @@ -40,6 +95,7 @@ jobs:

runs-on: ${{matrix.runs-on}}
timeout-minutes: 30
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/develop')
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -79,23 +135,24 @@ jobs:
# restore-keys: |
# ${{ matrix.runs-on }}-go-

- name: Test
run: |
echo "Running Build Tests"
make clean
make test
- name: Build zetacored and zetaclientd
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: ${{ env.CPU_ARCH }}
run: |
make clean
make install-testnet
cp "$HOME"/go/bin/* ./
- name: Test
run: |
echo "Running Build Tests"
make test
chmod a+x ./zetacored
./zetacored version
- name: Name Binaries
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/develop')
env:
Expand Down Expand Up @@ -170,6 +227,13 @@ jobs:
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Test
shell: alpine.sh --root {0}
run: |
echo "Running Build Tests"
apk add --no-cache --update
make clean
make test
- name: Build zetacored and zetaclientd
env:
Expand All @@ -178,18 +242,12 @@ jobs:
GOARCH: ${{ env.CPU_ARCH }}
shell: alpine.sh --root {0}
run: |
apk add --no-cache --update
make clean
git config --global --add safe.directory '*'
go mod tidy
make clean
make install-testnet
cp "$HOME"/go/bin/* ./
- name: Test
shell: alpine.sh --root {0}
run: |
echo "Running Build Tests"
make test
- name: Binary Docker Test
env:
Expand Down Expand Up @@ -284,7 +342,7 @@ jobs:
timeout-minutes: 15
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/develop')
needs:
- build-and-test
- build-and-test-multi-arch
- smoke-test
- build-alpine-and-test
steps:
Expand Down Expand Up @@ -401,7 +459,7 @@ jobs:
timeout-minutes: 60
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/release')
needs:
- build-and-test
- build-and-test-multi-arch
- build-alpine-and-test
- upload
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
coverage
coverage.json
coverage.out
coverage.html
node_modules
release/
typechain
Expand Down
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ TEST_DIR?="./..."
TEST_BUILD_FLAGS := -tags TESTNET,pebbledb,ledger
PRIV_BUILD_FLAGS := -tags PRIVNET,pebbledb,ledger

clean: clean-binaries clean-dir clean-test-dir
clean: clean-binaries clean-dir clean-test-dir clean-coverage

clean-binaries:
@rm -rf ${GOBIN}/zetacored
Expand All @@ -39,13 +39,18 @@ clean-dir:
all: install

test-coverage-exclude-core:
@go test {TEST_BUILD_FLAGS} -v -coverprofile coverage.out $(go list ./... | grep -v /x/zetacore/)
@go test ${TEST_BUILD_FLAGS} -v -coverprofile coverage.out $(go list ./... | grep -v /x/zetacore/)

test-coverage:
@go test ${TEST_BUILD_FLAGS} -v -coverprofile coverage.out ${TEST_DIR}
-@go test ${TEST_BUILD_FLAGS} -v -coverprofile coverage.out ${TEST_DIR}

coverage-report: test-coverage
@go tool cover -html=cover.txt
@go tool cover -html=coverage.out -o coverage.html

clean-coverage:
@rm -f coverage.out
@rm -f coverage.html

clean-test-dir:
@rm -rf x/crosschain/client/integrationtests/.zetacored
@rm -rf x/crosschain/client/querytests/.zetacored
Expand Down
6 changes: 1 addition & 5 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
tmjson "github.com/tendermint/tendermint/libs/json"

// this line is used by starport scaffolding # stargate/app/moduleImport
zetaCoreModule "github.com/zeta-chain/zetacore/x/crosschain"
zetaCoreModuleTypes "github.com/zeta-chain/zetacore/x/crosschain/types"

Expand Down Expand Up @@ -151,8 +150,6 @@ var (
Bech32PrefixConsPub = AccountAddressPrefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic
)

// this line is used by starport scaffolding # stargate/wasm/app/enabledProposals

func getGovProposalHandlers() []govclient.ProposalHandler {
var govProposalHandlers []govclient.ProposalHandler
govProposalHandlers = append(govProposalHandlers,
Expand Down Expand Up @@ -405,7 +402,7 @@ func New(
app.AccountKeeper,
app.BankKeeper,
app.ZetaObserverKeeper,
app.FungibleKeeper,
&app.FungibleKeeper,
)
app.GroupKeeper = groupkeeper.NewKeeper(keys[group.StoreKey], appCodec, app.MsgServiceRouter(), app.AccountKeeper, group.Config{
MaxExecutionPeriod: 2 * time.Hour, // Two hours.
Expand Down Expand Up @@ -759,7 +756,6 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino
paramsKeeper.Subspace(evmtypes.ModuleName)
paramsKeeper.Subspace(feemarkettypes.ModuleName)
paramsKeeper.Subspace(group.ModuleName)
// this line is used by starport scaffolding # stargate/app/paramSubspace
paramsKeeper.Subspace(zetaCoreModuleTypes.ModuleName)
paramsKeeper.Subspace(zetaObserverModuleTypes.ModuleName)
paramsKeeper.Subspace(fungibleModuleTypes.ModuleName)
Expand Down
2 changes: 0 additions & 2 deletions cmd/zetacored/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ func (ac appCreator) appExport(
homePath,
uint(1),
ac.encCfg,
// this line is used by starport scaffolding # stargate/root/exportArgument
appOpts,
)

Expand All @@ -299,7 +298,6 @@ func (ac appCreator) appExport(
homePath,
uint(1),
ac.encCfg,
// this line is used by starport scaffolding # stargate/root/noHeightExportArgument
appOpts,
)
}
Expand Down
3 changes: 0 additions & 3 deletions proto/crosschain/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import "crosschain/last_block_height.proto";
import "crosschain/out_tx_tracker.proto";
import "crosschain/params.proto";
import "crosschain/tss.proto";
// this line is used by starport scaffolding # genesis/proto/import
import "gogoproto/gogo.proto";

option go_package = "github.com/zeta-chain/zetacore/x/crosschain/types";
Expand All @@ -25,6 +24,4 @@ message GenesisState {

repeated LastBlockHeight lastBlockHeightList = 8;
repeated InTxHashToCctx inTxHashToCctxList = 9 [(gogoproto.nullable) = false];

// this line is used by starport scaffolding # genesis/proto/state
}
5 changes: 0 additions & 5 deletions proto/crosschain/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import "crosschain/nonce_to_cctx.proto";
import "crosschain/out_tx_tracker.proto";
import "crosschain/params.proto";
import "crosschain/tss.proto";
// this line is used by starport scaffolding # 1
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";

Expand Down Expand Up @@ -53,8 +52,6 @@ service Query {
option (google.api.http).get = "/zeta-chain/crosschain/get_tss_address";
}

// this line is used by starport scaffolding # 2

// Queries a tSS by index.
rpc TSS(QueryGetTSSRequest) returns (QueryGetTSSResponse) {
option (google.api.http).get = "/zeta-chain/crosschain/TSS";
Expand Down Expand Up @@ -183,8 +180,6 @@ message QueryGetTssAddressResponse {
string btc = 2;
}

// this line is used by starport scaffolding # 3

message QueryGetTSSRequest {}

message QueryGetTSSResponse {
Expand Down
3 changes: 0 additions & 3 deletions proto/crosschain/tx.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
syntax = "proto3";
package zetachain.zetacore.crosschain;

// this line is used by starport scaffolding # proto/tx/import
import "common/common.proto";
import "gogoproto/gogo.proto";

Expand All @@ -16,7 +15,6 @@ service Msg {
rpc NonceVoter(MsgNonceVoter) returns (MsgNonceVoterResponse);
rpc VoteOnObservedOutboundTx(MsgVoteOnObservedOutboundTx) returns (MsgVoteOnObservedOutboundTxResponse);
rpc VoteOnObservedInboundTx(MsgVoteOnObservedInboundTx) returns (MsgVoteOnObservedInboundTxResponse);
// this line is used by starport scaffolding # proto/tx/rpc
}

message MsgAddToOutTxTracker {
Expand All @@ -36,7 +34,6 @@ message MsgRemoveFromOutTxTracker {

message MsgRemoveFromOutTxTrackerResponse {}

// this line is used by starport scaffolding # proto/tx/message
message MsgCreateTSSVoter {
string creator = 1;
string tss_pubkey = 2;
Expand Down
2 changes: 0 additions & 2 deletions proto/emissions/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package zetachain.zetacore.emissions;

import "emissions/params.proto";
import "gogoproto/gogo.proto";
// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/zeta-chain/zetacore/x/emissions/types";

// GenesisState defines the emissions module's genesis state.
message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
// this line is used by starport scaffolding # genesis/proto/state
}
5 changes: 0 additions & 5 deletions proto/emissions/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "cosmos/base/query/v1beta1/pagination.proto";
import "emissions/params.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
// this line is used by starport scaffolding # 1

option go_package = "github.com/zeta-chain/zetacore/x/emissions/types";

Expand All @@ -19,8 +18,6 @@ service Query {
rpc ListPoolAddresses(QueryListPoolAddressesRequest) returns (QueryListPoolAddressesResponse) {
option (google.api.http).get = "/zeta-chain/zetacore/emissions/list_addresses";
}

// this line is used by starport scaffolding # 2
}

// QueryParamsRequest is request type for the Query/Params RPC method.
Expand All @@ -39,5 +36,3 @@ message QueryListPoolAddressesResponse {
string undistributed_tss_balances_address = 2;
string emission_module_address = 3;
}

// this line is used by starport scaffolding # 3
5 changes: 0 additions & 5 deletions proto/emissions/tx.proto
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
syntax = "proto3";
package zetachain.zetacore.emissions;

// this line is used by starport scaffolding # proto/tx/import

import "gogoproto/gogo.proto";

option go_package = "github.com/zeta-chain/zetacore/x/emissions/types";

// Msg defines the Msg service.
service Msg {
// this line is used by starport scaffolding # proto/tx/rpc
}

// this line is used by starport scaffolding # proto/tx/message
2 changes: 0 additions & 2 deletions proto/fungible/genesis.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import "fungible/foreign_coins.proto";
import "fungible/params.proto";
import "fungible/system_contract.proto";
import "gogoproto/gogo.proto";
// this line is used by starport scaffolding # genesis/proto/import

option go_package = "github.com/zeta-chain/zetacore/x/fungible/types";

Expand All @@ -14,5 +13,4 @@ message GenesisState {
Params params = 1 [(gogoproto.nullable) = false];
repeated ForeignCoins foreignCoinsList = 2 [(gogoproto.nullable) = false];
SystemContract systemContract = 3;
// this line is used by starport scaffolding # genesis/proto/state
}
3 changes: 0 additions & 3 deletions proto/fungible/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import "fungible/params.proto";
import "fungible/system_contract.proto";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
// this line is used by starport scaffolding # 1

option go_package = "github.com/zeta-chain/zetacore/x/fungible/types";

Expand All @@ -31,7 +30,6 @@ service Query {
rpc SystemContract(QueryGetSystemContractRequest) returns (QueryGetSystemContractResponse) {
option (google.api.http).get = "/zeta-chain/zetacore/fungible/system_contract";
}
// this line is used by starport scaffolding # 2
}

// QueryParamsRequest is request type for the Query/Params RPC method.
Expand Down Expand Up @@ -65,4 +63,3 @@ message QueryGetSystemContractRequest {}
message QueryGetSystemContractResponse {
SystemContract SystemContract = 1 [(gogoproto.nullable) = false];
}
// this line is used by starport scaffolding # 3
Loading

0 comments on commit 2c99443

Please sign in to comment.