diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 000000000..c4c84d86a --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,33 @@ +name: integration-ci + +on: ["push", "pull_request", "workflow_dispatch"] + +jobs: + integration-test: + runs-on: ubuntu-latest + env: + GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + steps: + - uses: actions/checkout@v3 + - name: Setup go + uses: actions/setup-go@v3 + with: + go-version: 1.16 + - name: Checkout + uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - run: sudo apt-get update -y && sudo apt-get install -y expect + - run: git config --global url."https://${{ secrets.GH_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com" + - run: go env -w GOPRIVATE="github.com/bnb-chain/*" + # used to debug workflow +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 + - run: make integration_test + - run: make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..b9633943c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,157 @@ +name: Release + +on: + push: + # Publish `v1.2.3` tags as releases. + tags: + - v* + +jobs: + build: + name: Build Release + strategy: + matrix: + go-version: [1.16.x] + os: [ubuntu-18.04, macos-11, windows-2019] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - uses: actions/cache@v2 + with: + # In order: + # * Module download cache + # * Build cache (Linux) + # * Build cache (Mac) + # * Build cache (Windows) + path: | + ~/go/pkg/mod + ~/.cache/go-build + ~/Library/Caches/go-build + %LocalAppData%\go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - run: go env -w GOPRIVATE="github.com/bnb-chain/*" + - run: git config --global url."https://${{ secrets.GH_ACCESS_TOKEN }}@github.com".insteadOf "https://github.com" + + # ============================== + # Linux/Macos/Windows Build + # ============================== + +# used to debug workflow +# - name: Setup tmate session +# uses: mxschmitt/action-tmate@v3 + + - name: Build Binary for ${{matrix.os}} + run: make build + + # ============================== + # Upload artifacts + # ============================== + + - name: Upload Linux Build + uses: actions/upload-artifact@v2 + if: matrix.os == 'ubuntu-18.04' + with: + name: linux + path: ./build + + - name: Upload MacOS Build + uses: actions/upload-artifact@v2 + if: matrix.os == 'macos-11' + with: + name: macos + path: ./build + + - name: Upload Windows Build + uses: actions/upload-artifact@v2 + if: matrix.os == 'windows-2019' + with: + name: windows + path: ./build + + release: + name: Release + needs: build + runs-on: ubuntu-18.04 + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + # ============================== + # Download artifacts + # ============================== + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: linux + path: ./linux + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: macos + path: ./macos + + - name: Download Artifacts + uses: actions/download-artifact@v2 + with: + name: windows + path: ./windows + + - run: zip -r linux.zip linux + - run: zip -r macos.zip macos + - run: zip -r windows.zip windows + + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} + draft: false + prerelease: false + + # Check downloaded files + - run: ls + + - name: Upload Release Asset - Linux + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./linux.zip + asset_name: bnb-chain-node-binary-linux-${{ github.ref_name }}.zip + asset_content_type: application/octet-stream + + - name: Upload Release Asset - MacOS + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./macos.zip + asset_name: bnb-chain-node-binary-macos-${{ github.ref_name }}.zip + asset_content_type: application/octet-stream + + - name: Upload Release Asset - Windows + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./windows.zip + asset_name: bnb-chain-node-binary-windows-${{ github.ref_name }}.zip + asset_content_type: application/octet-stream diff --git a/Makefile b/Makefile index 3d19c9b28..9ccd16ead 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ define buildwindows endef -build: get_tools +build: ifeq ($(OS),Windows_NT) $(call buildwindows) else @@ -155,7 +155,7 @@ get_tools: @echo "--> Installing tools" ./scripts/get_tools.sh -test: +test: get_tools make set_with_deadlock make test_unit make test_race diff --git a/app/app_paramhub_test.go b/app/app_paramhub_test.go index fe9d9ce70..001f3bf3c 100644 --- a/app/app_paramhub_test.go +++ b/app/app_paramhub_test.go @@ -9,6 +9,8 @@ import ( "testing" "time" + "github.com/bnb-chain/node/common/upgrade" + "github.com/stretchr/testify/assert" "github.com/tendermint/go-amino" @@ -50,7 +52,7 @@ var ( logger = log.NewTMLogger(os.Stdout) genAccs, addrs, pubKeys, privKeys = mock.CreateGenAccounts(4, sdk.Coins{sdk.NewCoin("BNB", 500000e8), sdk.NewCoin("BTC-000", 200e8)}) - testScParams = `[{"type": "params/StakeParamSet","value": {"unbonding_time": "604800000000000","max_validators": 11,"bond_denom": "BNB","min_self_delegation": "5000000000000","min_delegation_change": "100000000","reward_distribution_batch_size":"200"}},{"type": "params/SlashParamSet","value": {"max_evidence_age": "259200000000000","signed_blocks_window": "0","min_signed_per_window": "0","double_sign_unbond_duration": "9223372036854775807","downtime_unbond_duration": "172800000000000","too_low_del_unbond_duration": "86400000000000","slash_fraction_double_sign": "0","slash_fraction_downtime": "0","double_sign_slash_amount": "1000000000000","downtime_slash_amount": "5000000000","submitter_reward": "100000000000","downtime_slash_fee": "1000000000"}},{"type": "params/OracleParamSet","value": {"ConsensusNeeded": "70000000"}},{"type": "params/IbcParamSet","value": {"relayer_fee": "1000000"}}]` + testScParams = `[{"type": "params/StakeParamSet","value": {"unbonding_time": "604800000000000","max_validators": 11,"bond_denom": "BNB","min_self_delegation": "5000000000000","min_delegation_change": "100000000","reward_distribution_batch_size":"1000"}},{"type": "params/SlashParamSet","value": {"max_evidence_age": "259200000000000","signed_blocks_window": "0","min_signed_per_window": "0","double_sign_unbond_duration": "9223372036854775807","downtime_unbond_duration": "172800000000000","too_low_del_unbond_duration": "86400000000000","slash_fraction_double_sign": "0","slash_fraction_downtime": "0","double_sign_slash_amount": "1000000000000","downtime_slash_amount": "5000000000","submitter_reward": "100000000000","downtime_slash_fee": "1000000000"}},{"type": "params/OracleParamSet","value": {"ConsensusNeeded": "70000000"}},{"type": "params/IbcParamSet","value": {"relayer_fee": "1000000"}}]` testClient *TestClient testApp *BinanceChain ) @@ -251,6 +253,7 @@ func TestSubmitCSCParamUpdatesFail(t *testing.T) { } func TestSCParamUpdatesSuccess(t *testing.T) { + upgrade.Mgr.AddUpgradeHeight(upgrade.BEP128, -1) valAddr, ctx, accounts := setupTest() sideValAddr := accounts[0].GetAddress().Bytes() tNow := time.Now() diff --git a/app/pub/publisher.go b/app/pub/publisher.go index 65b9c048c..31666a574 100644 --- a/app/pub/publisher.go +++ b/app/pub/publisher.go @@ -48,7 +48,7 @@ func PublishEvent( ToPublishEventCh <-chan *sub.ToPublishEvent) { for toPublish := range ToPublishEventCh { eventData := toPublish.EventData - Logger.Debug("publisher queue status", "size", len(ToPublishCh)) + //Logger.Debug("publisher queue status", "size", len(ToPublishCh)) if cfg.PublishStaking { var msgNum int var validators []*Validator diff --git a/go.mod b/go.mod index 0d6b70f7d..a3d635bef 100644 --- a/go.mod +++ b/go.mod @@ -14,8 +14,10 @@ require ( github.com/linkedin/goavro v0.0.0-20180427201934-fa8f6a30176c github.com/mitchellh/go-homedir v1.1.0 github.com/natefinch/lumberjack v2.0.0+incompatible + github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.8.1 github.com/prometheus/client_golang v1.1.0 + github.com/sasha-s/go-deadlock v0.2.1-0.20180822072021-d68e2bc52ae3 // indirect github.com/spf13/cobra v0.0.5 github.com/spf13/viper v1.4.0 github.com/stretchr/testify v1.4.0 diff --git a/go.sum b/go.sum index 71064df80..6283cdd75 100644 --- a/go.sum +++ b/go.sum @@ -54,7 +54,7 @@ github.com/btcsuite/btcd v0.0.0-20190115013929-ed77733ec07d/go.mod h1:d3C0AkH6BR github.com/btcsuite/btcd v0.0.0-20190213025234-306aecffea32/go.mod h1:DrZx5ec/dmnfpw9KyYoQyYo7d0KEvTkk/5M/vbZjAr8= github.com/btcsuite/btcd v0.0.0-20190523000118-16327141da8c/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= github.com/btcsuite/btcd v0.0.0-20190629003639-c26ffa870fd8/go.mod h1:3J08xEfcugPacsc34/LKRU2yO7YmuT8yt28J8k2+rrI= -github.com/btcsuite/btcd v0.20.0-beta h1:PamBMopnHxO2nEIsU89ibVVnqnXR2yFTgGNc+PdG68o= +github.com/btcsuite/btcd v0.20.0-beta h1:DnZGUjFbRkpytojHWwy6nfUSA7vFrzWXDLpFNzt74ZA= github.com/btcsuite/btcd v0.20.0-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= github.com/btcsuite/btcutil v0.0.0-20180706230648-ab6388e0c60a/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= @@ -413,6 +413,8 @@ github.com/otiai10/primes v0.0.0-20180210170552-f6d2a1ba97c4/go.mod h1:UmSP7QeU3 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.4.0 h1:u3Z1r+oOXJIkxqw34zVhyPgjBsm6X2wn21NWs/HfSeg= github.com/pelletier/go-toml v1.4.0/go.mod h1:PN7xzY2wHTK0K9p34ErDQMlFxa51Fk0OUruD3k1mMwo= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 h1:q2e307iGHPdTGp0hoxKjt1H5pDo6utceo3dQVK3I5XQ= +github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pierrec/lz4 v2.0.5+incompatible h1:2xWsjqPFWcplujydGg4WmhC/6fZqK42wMM8aXeqhl0I= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= @@ -450,6 +452,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rs/cors v1.6.0 h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sasha-s/go-deadlock v0.2.1-0.20180822072021-d68e2bc52ae3 h1:PFrDl/KPigLkWkRl/AqIztEvC/iSnwKmTCy9qbqgevw= +github.com/sasha-s/go-deadlock v0.2.1-0.20180822072021-d68e2bc52ae3/go.mod h1:StQn567HiB1fF2yJ44N9au7wOhrPS3iZqiDbRupzT10= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/smola/gocompat v0.2.0/go.mod h1:1B0MlxbmoZNo3h8guHp8HztB3BSYR5itql9qtVc0ypY= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= @@ -582,6 +586,7 @@ golang.org/x/tools v0.0.0-20181130052023-1c3d964395ce/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA= diff --git a/integration_test.sh b/integration_test.sh index 74f55cffc..83d391ca2 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -ex + cd ./build if [ $? -ne 0 ]; then echo "path build does not exists" @@ -65,7 +67,6 @@ function check_operation() { secret=$(prepare_node) - result=$(expect ./recover.exp "${secret}" "alice" true) check_operation "Recover Key" "${result}" "${keys_operation_words}" diff --git a/networks/demo/HTLT-cross-chain.exp b/networks/demo/HTLT-cross-chain.exp index 3dcd33ec5..c16d5329b 100644 --- a/networks/demo/HTLT-cross-chain.exp +++ b/networks/demo/HTLT-cross-chain.exp @@ -17,4 +17,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/HTLT-single-chain.exp b/networks/demo/HTLT-single-chain.exp index 0090643ea..ef500d2db 100644 --- a/networks/demo/HTLT-single-chain.exp +++ b/networks/demo/HTLT-single-chain.exp @@ -16,4 +16,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/add_key.exp b/networks/demo/add_key.exp index bf2aca78c..e46e114c0 100755 --- a/networks/demo/add_key.exp +++ b/networks/demo/add_key.exp @@ -9,4 +9,4 @@ set timeout 30 send "12345678\r" expect "Repeat*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/cancel.exp b/networks/demo/cancel.exp index 55232b21d..3a60498f8 100755 --- a/networks/demo/cancel.exp +++ b/networks/demo/cancel.exp @@ -14,4 +14,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/claim.exp b/networks/demo/claim.exp index 89359378f..220b2272c 100644 --- a/networks/demo/claim.exp +++ b/networks/demo/claim.exp @@ -14,4 +14,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/deposit.exp b/networks/demo/deposit.exp index 8deb57695..777041835 100644 --- a/networks/demo/deposit.exp +++ b/networks/demo/deposit.exp @@ -14,4 +14,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/issue.exp b/networks/demo/issue.exp index 9837b3ccb..a1d8890ff 100755 --- a/networks/demo/issue.exp +++ b/networks/demo/issue.exp @@ -16,4 +16,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/issue_mini.exp b/networks/demo/issue_mini.exp index 39a86f5b3..e488f6968 100755 --- a/networks/demo/issue_mini.exp +++ b/networks/demo/issue_mini.exp @@ -18,4 +18,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/list.exp b/networks/demo/list.exp index 454953ba9..2b4e7121c 100755 --- a/networks/demo/list.exp +++ b/networks/demo/list.exp @@ -16,4 +16,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/list_mini.exp b/networks/demo/list_mini.exp index 58cf6f515..252e63f0a 100755 --- a/networks/demo/list_mini.exp +++ b/networks/demo/list_mini.exp @@ -16,4 +16,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/mint.exp b/networks/demo/mint.exp index c1528d9a5..438b2f78f 100644 --- a/networks/demo/mint.exp +++ b/networks/demo/mint.exp @@ -14,4 +14,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/multi_send.exp b/networks/demo/multi_send.exp index 4e62bf174..1fe6daf0c 100755 --- a/networks/demo/multi_send.exp +++ b/networks/demo/multi_send.exp @@ -10,4 +10,4 @@ set timeout 30 spawn ./bnbcli token multi-send --home $home --from $from --chain-id=$chain_id --transfers $tx --memo $memo expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/order.exp b/networks/demo/order.exp index 74999be30..61b257782 100755 --- a/networks/demo/order.exp +++ b/networks/demo/order.exp @@ -17,4 +17,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/propose_list.exp b/networks/demo/propose_list.exp index e5229a591..0559e4a2b 100755 --- a/networks/demo/propose_list.exp +++ b/networks/demo/propose_list.exp @@ -16,4 +16,4 @@ set timeout 30 spawn ./bnbcli gov submit-list-proposal --chain-id ${chain_id} --from ${from} --deposit ${deposit} --base-asset-symbol ${base_asset} --quote-asset-symbol ${quote_asset} --init-price ${init_price} --title ${title} --description ${description} --home ${home} --expire-time ${expire_time} --voting-period ${voting_period} expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/recover.exp b/networks/demo/recover.exp index 7e51eaa08..6aa0a57eb 100755 --- a/networks/demo/recover.exp +++ b/networks/demo/recover.exp @@ -18,4 +18,4 @@ set timeout 30 send "12345678\r" expect "Enter*" send "${secret}\r" -interact +expect eof diff --git a/networks/demo/refund.exp b/networks/demo/refund.exp index c9df3d237..42a879e91 100644 --- a/networks/demo/refund.exp +++ b/networks/demo/refund.exp @@ -13,4 +13,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/send.exp b/networks/demo/send.exp index c4ff1020c..fa164b5a2 100755 --- a/networks/demo/send.exp +++ b/networks/demo/send.exp @@ -11,4 +11,4 @@ set timeout 30 spawn ./bnbcli send --home $home --from $from --chain-id=$chain_id --amount $amount --to $to --memo $memo expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/set_account_flags.exp b/networks/demo/set_account_flags.exp index 48f18bfb3..929dc8b54 100644 --- a/networks/demo/set_account_flags.exp +++ b/networks/demo/set_account_flags.exp @@ -13,4 +13,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/seturi.exp b/networks/demo/seturi.exp index c1528d9a5..438b2f78f 100644 --- a/networks/demo/seturi.exp +++ b/networks/demo/seturi.exp @@ -14,4 +14,4 @@ set timeout 30 } expect "Password*" send "12345678\r" -interact +expect eof diff --git a/networks/demo/vote.exp b/networks/demo/vote.exp index 66e156b64..175ddadd9 100755 --- a/networks/demo/vote.exp +++ b/networks/demo/vote.exp @@ -10,4 +10,4 @@ set timeout 30 spawn ./bnbcli gov vote --from ${from} --chain-id ${chain_id} --proposal-id ${proposal_id} --option ${option} --home ${home} expect "Password*" send "12345678\r" -interact +expect eof diff --git a/plugins/api/handlers/simulate.go b/plugins/api/handlers/simulate.go index 8474cfa7a..adca24a0d 100644 --- a/plugins/api/handlers/simulate.go +++ b/plugins/api/handlers/simulate.go @@ -3,11 +3,12 @@ package handlers import ( "encoding/hex" "fmt" - "github.com/cosmos/cosmos-sdk/client/context" - sdk "github.com/cosmos/cosmos-sdk/types" "io" "net/http" + "github.com/cosmos/cosmos-sdk/client/context" + sdk "github.com/cosmos/cosmos-sdk/types" + cctx "github.com/bnb-chain/node/common/client/context" "github.com/bnb-chain/node/wire" ) diff --git a/scripts/get_tools.sh b/scripts/get_tools.sh index ec0ab02e3..48eac8b5c 100755 --- a/scripts/get_tools.sh +++ b/scripts/get_tools.sh @@ -1,45 +1,6 @@ #!/usr/bin/env bash -set -e +set -ex -# This file downloads all of the binary dependencies we have, and checks out a -# specific git hash. - -## check if GOPATH is set -if [ -z ${GOPATH+x} ]; then - echo "please set GOPATH (https://github.com/golang/go/wiki/SettingGOPATH)" - exit 1 -fi - -mkdir -p "$GOPATH/src/github.com" -cd "$GOPATH/src/github.com" || exit 1 - -installFromGithub() { - repo=$1 - commit=$2 - # optional - subdir=$3 - echo "--> Installing $repo ($commit)..." - if [ ! -d "$repo" ]; then - mkdir -p "$repo" - git clone "https://github.com/$repo.git" "$repo" - fi - if [ ! -z ${subdir+x} ] && [ ! -d "$repo/$subdir" ]; then - echo "ERROR: no such directory $repo/$subdir" - exit 1 - fi - pushd "$repo" && \ - git fetch origin && \ - git checkout -q "$commit" && \ - if [ ! -z ${subdir+x} ]; then cd "$subdir" || exit 1; fi && \ - go install && \ - if [ ! -z ${subdir+x} ]; then cd - || exit 1; fi && \ - popd || exit 1 - echo "--> Done" - echo "" -} - -######################## COMMON TOOLS ######################################## -## XXX: https://github.com/tendermint/tendermint/issues/3242 -installFromGithub petermattis/goid b0b1615b78e5ee59739545bb38426383b2cda4c9 -installFromGithub sasha-s/go-deadlock d68e2bc52ae3291765881b9056f2c1527f245f1e -go get golang.org/x/tools/cmd/goimports +go install golang.org/x/tools/cmd/goimports@latest +go get github.com/petermattis/goid@b0b1615b78e5ee59739545bb38426383b2cda4c9 +go get github.com/sasha-s/go-deadlock@d68e2bc52ae3291765881b9056f2c1527f245f1e