From d72d2b5957bc2bdceae1eb414e8382e5906f289f Mon Sep 17 00:00:00 2001 From: dudong2 Date: Wed, 29 Nov 2023 16:33:49 +0900 Subject: [PATCH] test: debug go ver for deploy-contract, fix lint checker --- Makefile | 1 + proto/ethermint/feemarket/v1/feemarket.proto | 2 +- scripts/proto-tools-installer.sh | 10 +++++----- tests/integration_tests/test_grpc_only.py | 8 ++++---- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ac5a76f8d6..6d3f56b37c 100644 --- a/Makefile +++ b/Makefile @@ -234,6 +234,7 @@ $(STATIK): contract-tools: ifeq (, $(shell which stringer)) @echo "Installing stringer..." + @echo "$(go version)" @go get golang.org/x/tools/cmd/stringer else @echo "stringer already installed; skipping..." diff --git a/proto/ethermint/feemarket/v1/feemarket.proto b/proto/ethermint/feemarket/v1/feemarket.proto index cc494f25c3..2d9a687be0 100644 --- a/proto/ethermint/feemarket/v1/feemarket.proto +++ b/proto/ethermint/feemarket/v1/feemarket.proto @@ -1,8 +1,8 @@ syntax = "proto3"; package ethermint.feemarket.v1; -import "gogoproto/gogo.proto"; import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; option go_package = "github.com/evmos/ethermint/x/feemarket/types"; diff --git a/scripts/proto-tools-installer.sh b/scripts/proto-tools-installer.sh index c9151d8692..6f8be7fe19 100755 --- a/scripts/proto-tools-installer.sh +++ b/scripts/proto-tools-installer.sh @@ -33,7 +33,7 @@ esac TEMPDIR="$(mktemp -d)" -trap "rm -rvf '${TEMPDIR}'" EXIT +trap 'rm -rvf ${TEMPDIR}' EXIT f_print_installing_with_padding() { printf "Installing %30s ..." "$1" >&2 @@ -67,8 +67,8 @@ f_install_protoc() { pushd "${TEMPDIR}" >/dev/null curl -o "${PROTOC_ZIP}" -sSL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}" - unzip -q -o ${PROTOC_ZIP} -d "${DESTDIR}"/${PREFIX} bin/protoc; \ - unzip -q -o ${PROTOC_ZIP} -d "${DESTDIR}"/${PREFIX} 'include/*'; \ + unzip -q -o ${PROTOC_ZIP} -d "${DESTDIR}"/"${PREFIX}" bin/protoc; \ + unzip -q -o ${PROTOC_ZIP} -d "${DESTDIR}"/"${PREFIX}" 'include/*'; \ rm -f ${PROTOC_ZIP} popd >/dev/null f_print_done @@ -133,10 +133,10 @@ f_install_clang_format() { fi ;; Darwin) - echo "\tRun: brew install clang-format" >&2 + printf "\tRun: brew install clang-format" >&2 ;; *) - echo "\tunknown operating system. Skipping." >&2 + printf "\tunknown operating system. Skipping." >&2 esac } diff --git a/tests/integration_tests/test_grpc_only.py b/tests/integration_tests/test_grpc_only.py index ca2d766152..62deb0d553 100644 --- a/tests/integration_tests/test_grpc_only.py +++ b/tests/integration_tests/test_grpc_only.py @@ -108,18 +108,18 @@ def expect_cb(rsp): wait_for_port(grpc_port) wait_for_port(api_port) - def expect_cb(rsp): + def expect_cb_internal1(rsp): assert rsp["code"] != 0, str(rsp) return "validator does not exist" in rsp["message"] # it don't works without proposer address neither - grpc_eth_call(api_port, msg, expect_cb, chain_id=9000) + grpc_eth_call(api_port, msg, expect_cb_internal1, chain_id=9000) # pass the first validator's consensus address to grpc query addr = custom_ethermint.cosmos_cli(0).consensus_address() cons_addr = decode_bech32(addr) - def expect_cb(rsp): + def expect_cb_internal2(rsp): ret = base64.b64decode(rsp["ret"].encode()) return "code" not in rsp and 100 == int.from_bytes(ret, "big") @@ -127,7 +127,7 @@ def expect_cb(rsp): grpc_eth_call( api_port, msg, - expect_cb, + expect_cb_internal2, chain_id=100, proposer_address=base64.b64encode(cons_addr).decode(), )