diff --git a/.github/workflows/.yamllint b/.github/workflows/.yamllint new file mode 100644 index 0000000000..54d03b1c27 --- /dev/null +++ b/.github/workflows/.yamllint @@ -0,0 +1,6 @@ +extends: default + +rules: + line-length: disable + truthy: disable + comments: {min-spaces-from-content: 1} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 240ee02aae..9bc0ec948b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,9 +7,7 @@ on: push: branches: - master - - release/** - - v0.*-dev - + - v[0-9]+.[0-9]+-dev jobs: build: name: Build diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index bc2cc1481c..f0bfd723d6 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -6,8 +6,13 @@ name: Check generated code on: pull_request: + paths: + - "**.go" + - "**.proto" + push: branches: - master + - v[0-9]+.[0-9]+-dev permissions: contents: read @@ -18,7 +23,7 @@ jobs: steps: - uses: actions/setup-go@v3.5.0 with: - go-version: '1.19' + go-version: "1.19" - uses: actions/checkout@v3 @@ -26,7 +31,7 @@ jobs: run: | set -euo pipefail - readonly MOCKERY=2.12.3 # N.B. no leading "v" + readonly MOCKERY=2.23.1 # N.B. no leading "v" curl -sL "https://github.com/vektra/mockery/releases/download/v${MOCKERY}/mockery_${MOCKERY}_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xzf - make mockery 2>/dev/null @@ -44,11 +49,11 @@ jobs: steps: - uses: actions/setup-go@v3.5.0 with: - go-version: '1.19' + go-version: "1.19" - uses: actions/checkout@v3 with: - fetch-depth: 1 # we need a .git directory to run git diff + fetch-depth: 1 # we need a .git directory to run git diff - name: "Check protobuf generated code" run: | diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 1ac660c654..aa4670f503 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -3,12 +3,15 @@ name: e2e # Runs the CI end-to-end test network on all pushes to master or release # branches and every pull request, but only if any Go files have been changed. on: - workflow_dispatch: # allow running workflow manually + workflow_dispatch: # allow running workflow manually pull_request: + paths: + - "**Dockerfile" + - "**.go" push: branches: - master - - release/** + - v[0-9]+.[0-9]+-dev jobs: e2e-test: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f7f543d81c..0affc7a510 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,9 +9,13 @@ name: Golang Linter on: pull_request: + paths: + - "**.go" push: branches: - master + - v[0-9]+.[0-9]+-dev + jobs: golangci: name: golangci-lint @@ -26,7 +30,7 @@ jobs: submodules: true - uses: actions/setup-go@v3.5.0 with: - go-version: '^1.19' + go-version: "^1.19" - uses: technote-space/get-diff-action@v6 with: PATTERNS: | diff --git a/.github/workflows/markdown-links.yml b/.github/workflows/markdown-links.yml index 7af7e3ce90..82a8b11c12 100644 --- a/.github/workflows/markdown-links.yml +++ b/.github/workflows/markdown-links.yml @@ -1,11 +1,15 @@ +--- name: Check Markdown links on: + # Temporarily disabled job on PRs. Re-enable when docs are fixed. + # pull_request: + # paths: + # - "**.md" push: branches: - master - pull_request: - branches: [master] + - v[0-9]+.[0-9]+-dev jobs: markdown-link-check: @@ -16,8 +20,8 @@ jobs: with: PATTERNS: | **/**.md - - uses: creachadair/github-action-markdown-link-check@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 with: - check-modified-files-only: 'yes' - config-file: '.md-link-check.json' + check-modified-files-only: "yes" + config-file: ".md-link-check.json" if: env.GIT_DIFF diff --git a/.github/workflows/linter.yml b/.github/workflows/markdown-linter.yml similarity index 85% rename from .github/workflows/linter.yml rename to .github/workflows/markdown-linter.yml index 290542bdea..264145a9da 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/markdown-linter.yml @@ -1,17 +1,14 @@ name: Markdown Linter on: - push: - branches: - - master - paths: - - "**.md" - - "**.yml" - - "**.yaml" pull_request: - branches: [master] paths: - "**.md" - "**.yml" + - "**.yaml" + push: + branches: + - master + - v[0-9]+.[0-9]+-dev jobs: build: @@ -23,7 +20,7 @@ jobs: - name: Install dependencies run: sudo apt-get update && sudo apt-get install -y libpcap-dev - name: Lint Code Base - uses: docker://github/super-linter:v4 + uses: github/super-linter@v4 env: VALIDATE_ALL_CODEBASE: true DEFAULT_BRANCH: master diff --git a/.github/workflows/proto-lint.yml b/.github/workflows/proto-lint.yml index c015d2d939..271decc37e 100644 --- a/.github/workflows/proto-lint.yml +++ b/.github/workflows/proto-lint.yml @@ -2,12 +2,11 @@ name: Protobuf Lint on: pull_request: paths: - - 'proto/**' + - "proto/**" push: branches: - master - paths: - - 'proto/**' + - v[0-9]+.[0-9]+-dev jobs: lint: @@ -18,4 +17,4 @@ jobs: - uses: bufbuild/buf-setup-action@v1.14.0 - uses: bufbuild/buf-lint-action@v1 with: - input: 'proto' + input: "proto" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 53084e64a6..aa7578b6f5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -2,13 +2,12 @@ name: Test on: pull_request: - push: paths: - "**.go" + push: branches: - master - - release/** - - v0.*-dev + - v[0-9].[0-9]+-dev jobs: tests: runs-on: ubuntu-latest diff --git a/abci/client/mocks/client.go b/abci/client/mocks/client.go index d316487e25..8d77c50c42 100644 --- a/abci/client/mocks/client.go +++ b/abci/client/mocks/client.go @@ -19,6 +19,10 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl ret := _m.Called(_a0, _a1) var r0 *types.ResponseApplySnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -27,7 +31,6 @@ func (_m *Client) ApplySnapshotChunk(_a0 context.Context, _a1 *types.RequestAppl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -42,6 +45,10 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type ret := _m.Called(_a0, _a1) var r0 *types.ResponseCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -50,7 +57,6 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) (*type } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { r1 = rf(_a0, _a1) } else { @@ -65,6 +71,10 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er ret := _m.Called(_a0, _a1) var r0 *types.ResponseEcho + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string) (*types.ResponseEcho, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, string) *types.ResponseEcho); ok { r0 = rf(_a0, _a1) } else { @@ -73,7 +83,6 @@ func (_m *Client) Echo(_a0 context.Context, _a1 string) (*types.ResponseEcho, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string) error); ok { r1 = rf(_a0, _a1) } else { @@ -102,6 +111,10 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) ret := _m.Called(_a0, _a1) var r0 *types.ResponseExtendVote + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { r0 = rf(_a0, _a1) } else { @@ -110,7 +123,6 @@ func (_m *Client) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendVote) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { r1 = rf(_a0, _a1) } else { @@ -125,6 +137,10 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB ret := _m.Called(_a0, _a1) var r0 *types.ResponseFinalizeBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { r0 = rf(_a0, _a1) } else { @@ -133,7 +149,6 @@ func (_m *Client) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFinalizeB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { r1 = rf(_a0, _a1) } else { @@ -162,6 +177,10 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp ret := _m.Called(_a0, _a1) var r0 *types.ResponseInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0, _a1) } else { @@ -170,7 +189,6 @@ func (_m *Client) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types.Resp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { r1 = rf(_a0, _a1) } else { @@ -185,6 +203,10 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* ret := _m.Called(_a0, _a1) var r0 *types.ResponseInitChain + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0, _a1) } else { @@ -193,7 +215,6 @@ func (_m *Client) InitChain(_a0 context.Context, _a1 *types.RequestInitChain) (* } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { r1 = rf(_a0, _a1) } else { @@ -222,6 +243,10 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps ret := _m.Called(_a0, _a1) var r0 *types.ResponseListSnapshots + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0, _a1) } else { @@ -230,7 +255,6 @@ func (_m *Client) ListSnapshots(_a0 context.Context, _a1 *types.RequestListSnaps } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { r1 = rf(_a0, _a1) } else { @@ -245,6 +269,10 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS ret := _m.Called(_a0, _a1) var r0 *types.ResponseLoadSnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -253,7 +281,6 @@ func (_m *Client) LoadSnapshotChunk(_a0 context.Context, _a1 *types.RequestLoadS } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -268,6 +295,10 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap ret := _m.Called(_a0, _a1) var r0 *types.ResponseOfferSnapshot + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0, _a1) } else { @@ -276,7 +307,6 @@ func (_m *Client) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOfferSnap } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { r1 = rf(_a0, _a1) } else { @@ -291,6 +321,10 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare ret := _m.Called(_a0, _a1) var r0 *types.ResponsePrepareProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { r0 = rf(_a0, _a1) } else { @@ -299,7 +333,6 @@ func (_m *Client) PrepareProposal(_a0 context.Context, _a1 *types.RequestPrepare } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -314,6 +347,10 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess ret := _m.Called(_a0, _a1) var r0 *types.ResponseProcessProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { r0 = rf(_a0, _a1) } else { @@ -322,7 +359,6 @@ func (_m *Client) ProcessProposal(_a0 context.Context, _a1 *types.RequestProcess } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -337,6 +373,10 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re ret := _m.Called(_a0, _a1) var r0 *types.ResponseQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0, _a1) } else { @@ -345,7 +385,6 @@ func (_m *Client) Query(_a0 context.Context, _a1 *types.RequestQuery) (*types.Re } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { r1 = rf(_a0, _a1) } else { @@ -374,6 +413,10 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer ret := _m.Called(_a0, _a1) var r0 *types.ResponseVerifyVoteExtension + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { r0 = rf(_a0, _a1) } else { @@ -382,7 +425,6 @@ func (_m *Client) VerifyVoteExtension(_a0 context.Context, _a1 *types.RequestVer } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/abci/types/mocks/application.go b/abci/types/mocks/application.go index 938b945a01..be32ed8e17 100644 --- a/abci/types/mocks/application.go +++ b/abci/types/mocks/application.go @@ -19,6 +19,10 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques ret := _m.Called(_a0, _a1) var r0 *types.ResponseApplySnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) (*types.ResponseApplySnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestApplySnapshotChunk) *types.ResponseApplySnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -27,7 +31,6 @@ func (_m *Application) ApplySnapshotChunk(_a0 context.Context, _a1 *types.Reques } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestApplySnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -42,6 +45,10 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( ret := _m.Called(_a0, _a1) var r0 *types.ResponseCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) (*types.ResponseCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestCheckTx) *types.ResponseCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -50,7 +57,6 @@ func (_m *Application) CheckTx(_a0 context.Context, _a1 *types.RequestCheckTx) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestCheckTx) error); ok { r1 = rf(_a0, _a1) } else { @@ -65,6 +71,10 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV ret := _m.Called(_a0, _a1) var r0 *types.ResponseExtendVote + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) (*types.ResponseExtendVote, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestExtendVote) *types.ResponseExtendVote); ok { r0 = rf(_a0, _a1) } else { @@ -73,7 +83,6 @@ func (_m *Application) ExtendVote(_a0 context.Context, _a1 *types.RequestExtendV } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestExtendVote) error); ok { r1 = rf(_a0, _a1) } else { @@ -88,6 +97,10 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina ret := _m.Called(_a0, _a1) var r0 *types.ResponseFinalizeBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) (*types.ResponseFinalizeBlock, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestFinalizeBlock) *types.ResponseFinalizeBlock); ok { r0 = rf(_a0, _a1) } else { @@ -96,7 +109,6 @@ func (_m *Application) FinalizeBlock(_a0 context.Context, _a1 *types.RequestFina } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestFinalizeBlock) error); ok { r1 = rf(_a0, _a1) } else { @@ -111,6 +123,10 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types ret := _m.Called(_a0, _a1) var r0 *types.ResponseInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) (*types.ResponseInfo, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInfo) *types.ResponseInfo); ok { r0 = rf(_a0, _a1) } else { @@ -119,7 +135,6 @@ func (_m *Application) Info(_a0 context.Context, _a1 *types.RequestInfo) (*types } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInfo) error); ok { r1 = rf(_a0, _a1) } else { @@ -134,6 +149,10 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai ret := _m.Called(_a0, _a1) var r0 *types.ResponseInitChain + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) (*types.ResponseInitChain, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestInitChain) *types.ResponseInitChain); ok { r0 = rf(_a0, _a1) } else { @@ -142,7 +161,6 @@ func (_m *Application) InitChain(_a0 context.Context, _a1 *types.RequestInitChai } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestInitChain) error); ok { r1 = rf(_a0, _a1) } else { @@ -157,6 +175,10 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList ret := _m.Called(_a0, _a1) var r0 *types.ResponseListSnapshots + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) (*types.ResponseListSnapshots, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestListSnapshots) *types.ResponseListSnapshots); ok { r0 = rf(_a0, _a1) } else { @@ -165,7 +187,6 @@ func (_m *Application) ListSnapshots(_a0 context.Context, _a1 *types.RequestList } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestListSnapshots) error); ok { r1 = rf(_a0, _a1) } else { @@ -180,6 +201,10 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request ret := _m.Called(_a0, _a1) var r0 *types.ResponseLoadSnapshotChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) (*types.ResponseLoadSnapshotChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestLoadSnapshotChunk) *types.ResponseLoadSnapshotChunk); ok { r0 = rf(_a0, _a1) } else { @@ -188,7 +213,6 @@ func (_m *Application) LoadSnapshotChunk(_a0 context.Context, _a1 *types.Request } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestLoadSnapshotChunk) error); ok { r1 = rf(_a0, _a1) } else { @@ -203,6 +227,10 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe ret := _m.Called(_a0, _a1) var r0 *types.ResponseOfferSnapshot + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) (*types.ResponseOfferSnapshot, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestOfferSnapshot) *types.ResponseOfferSnapshot); ok { r0 = rf(_a0, _a1) } else { @@ -211,7 +239,6 @@ func (_m *Application) OfferSnapshot(_a0 context.Context, _a1 *types.RequestOffe } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestOfferSnapshot) error); ok { r1 = rf(_a0, _a1) } else { @@ -226,6 +253,10 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr ret := _m.Called(_a0, _a1) var r0 *types.ResponsePrepareProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) (*types.ResponsePrepareProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestPrepareProposal) *types.ResponsePrepareProposal); ok { r0 = rf(_a0, _a1) } else { @@ -234,7 +265,6 @@ func (_m *Application) PrepareProposal(_a0 context.Context, _a1 *types.RequestPr } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestPrepareProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -249,6 +279,10 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr ret := _m.Called(_a0, _a1) var r0 *types.ResponseProcessProposal + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) (*types.ResponseProcessProposal, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestProcessProposal) *types.ResponseProcessProposal); ok { r0 = rf(_a0, _a1) } else { @@ -257,7 +291,6 @@ func (_m *Application) ProcessProposal(_a0 context.Context, _a1 *types.RequestPr } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestProcessProposal) error); ok { r1 = rf(_a0, _a1) } else { @@ -272,6 +305,10 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ ret := _m.Called(_a0, _a1) var r0 *types.ResponseQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) (*types.ResponseQuery, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestQuery) *types.ResponseQuery); ok { r0 = rf(_a0, _a1) } else { @@ -280,7 +317,6 @@ func (_m *Application) Query(_a0 context.Context, _a1 *types.RequestQuery) (*typ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestQuery) error); ok { r1 = rf(_a0, _a1) } else { @@ -295,6 +331,10 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque ret := _m.Called(_a0, _a1) var r0 *types.ResponseVerifyVoteExtension + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) (*types.ResponseVerifyVoteExtension, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *types.RequestVerifyVoteExtension) *types.ResponseVerifyVoteExtension); ok { r0 = rf(_a0, _a1) } else { @@ -303,7 +343,6 @@ func (_m *Application) VerifyVoteExtension(_a0 context.Context, _a1 *types.Reque } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *types.RequestVerifyVoteExtension) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/abci/types/types.pb.go b/abci/types/types.pb.go index 1d94d98935..78b749efd2 100644 --- a/abci/types/types.pb.go +++ b/abci/types/types.pb.go @@ -1642,6 +1642,7 @@ func (m *RequestFinalizeBlock) GetBlockID() *types1.BlockID { type Response struct { // Types that are valid to be assigned to Value: + // // *Response_Exception // *Response_Echo // *Response_Flush @@ -3428,7 +3429,8 @@ type ValidatorUpdate struct { Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"` ProTxHash []byte `protobuf:"bytes,3,opt,name=pro_tx_hash,json=proTxHash,proto3" json:"pro_tx_hash,omitempty"` // node_address is an URI containing address of validator (`proto://node_id@ip_address:port`), for example: - // `tcp://f2dbd9b0a1f541a7c44d34a58674d0262f5feca5@12.34.5.6:1234` + // + // `tcp://f2dbd9b0a1f541a7c44d34a58674d0262f5feca5@12.34.5.6:1234` NodeAddress string `protobuf:"bytes,4,opt,name=node_address,json=nodeAddress,proto3" json:"node_address,omitempty"` } diff --git a/bin/LICENSE b/bin/LICENSE new file mode 100644 index 0000000000..873b122fe4 --- /dev/null +++ b/bin/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2014, Opinionated Architecture +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the {organization} nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/bin/README.md b/bin/README.md new file mode 100644 index 0000000000..08c06719f4 --- /dev/null +++ b/bin/README.md @@ -0,0 +1,39 @@ + +mockery +======= +[![Release](https://github.com/vektra/mockery/actions/workflows/release.yml/badge.svg)](https://github.com/vektra/mockery/actions/workflows/release.yml) [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/github.com/vektra/mockery/v2?tab=overview) ![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/vektra/mockery) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/vektra/mockery) [![Go Report Card](https://goreportcard.com/badge/github.com/vektra/mockery)](https://goreportcard.com/report/github.com/vektra/mockery) [![codecov](https://codecov.io/gh/vektra/mockery/branch/master/graph/badge.svg)](https://codecov.io/gh/vektra/mockery) + +mockery provides the ability to easily generate mocks for Golang interfaces using the [stretchr/testify/mock](https://pkg.go.dev/github.com/stretchr/testify/mock?tab=doc) package. It removes the boilerplate coding required to use mocks. + +Documentation +-------------- + +Documentation is found at out [Github Pages site](https://vektra.github.io/mockery/). + +Development Efforts +------------------- + +### v1 + +v1 is the original version of the software, and is no longer supported. + +### v2 + +`mockery` is currently in v2, which originally included cosmetic and configuration improvements over v1, but also implements a number of quality-of-life additions. + +### v3 + +[v3](https://github.com/vektra/mockery/projects/3) will include a ground-up overhaul of the entire codebase and will completely change how mockery works internally and externally. The highlights of the project are: +- Moving towards a package-based model instead of a file-based model. `mockery` currently iterates over every file in a project and calls `package.Load` on each one, which is time-consuming. Moving towards a model where the entire package is loaded at once will dramatically reduce runtime, and will simplify logic. Additionally, supporting only a single mode of operation (package mode) will greatly increase the intuitiveness of the software. +- Configuration-driven generation. `v3` will be entirely driven by configuration, meaning: + * You specify the packages you want mocked, instead of relying on it auto-discovering your package. Auto-discovery in theory sounds great, but in practice it leads to a great amount of complexity for very little benefit. + * Package- or interface-specific overrides can be given that change mock generation settings on a granular level. This will allow your mocks to be generated in a heterogeneous manner, and will be made explicit by YAML configuration. + - Proper error reporting. Errors across the board will be done in accordance with modern Golang practices + - Variables in generated mocks will be given meaningful names. + + + +Stargazers +---------- + +[![Stargazers over time](https://starchart.cc/vektra/mockery.svg)](https://starchart.cc/vektra/mockery) diff --git a/bin/mockery b/bin/mockery new file mode 100755 index 0000000000..b8a7a7f798 Binary files /dev/null and b/bin/mockery differ diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index 5a317bcf1c..520c7e6894 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -42,13 +42,17 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type ret := _m.Called(_a0, _a1, _a2, _a3) var r0 types.NodeInfo + var r1 crypto.PubKey + var r2 error + if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) (types.NodeInfo, crypto.PubKey, error)); ok { + return rf(_a0, _a1, _a2, _a3) + } if rf, ok := ret.Get(0).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) types.NodeInfo); ok { r0 = rf(_a0, _a1, _a2, _a3) } else { r0 = ret.Get(0).(types.NodeInfo) } - var r1 crypto.PubKey if rf, ok := ret.Get(1).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) crypto.PubKey); ok { r1 = rf(_a0, _a1, _a2, _a3) } else { @@ -57,7 +61,6 @@ func (_m *Connection) Handshake(_a0 context.Context, _a1 time.Duration, _a2 type } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context, time.Duration, types.NodeInfo, crypto.PrivKey) error); ok { r2 = rf(_a0, _a1, _a2, _a3) } else { @@ -86,13 +89,17 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byt ret := _m.Called(_a0) var r0 conn.ChannelID + var r1 []byte + var r2 error + if rf, ok := ret.Get(0).(func(context.Context) (conn.ChannelID, []byte, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) conn.ChannelID); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(conn.ChannelID) } - var r1 []byte if rf, ok := ret.Get(1).(func(context.Context) []byte); ok { r1 = rf(_a0) } else { @@ -101,7 +108,6 @@ func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byt } } - var r2 error if rf, ok := ret.Get(2).(func(context.Context) error); ok { r2 = rf(_a0) } else { diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index e89f0e25a3..7135a7ce4f 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -22,6 +22,10 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { ret := _m.Called(_a0) var r0 p2p.Connection + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (p2p.Connection, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) p2p.Connection); ok { r0 = rf(_a0) } else { @@ -30,7 +34,6 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -64,6 +67,10 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio ret := _m.Called(_a0, _a1) var r0 p2p.Connection + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) (p2p.Connection, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *p2p.Endpoint) p2p.Connection); ok { r0 = rf(_a0, _a1) } else { @@ -72,7 +79,6 @@ func (_m *Transport) Dial(_a0 context.Context, _a1 *p2p.Endpoint) (p2p.Connectio } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *p2p.Endpoint) error); ok { r1 = rf(_a0, _a1) } else { @@ -87,6 +93,10 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { ret := _m.Called() var r0 *p2p.Endpoint + var r1 error + if rf, ok := ret.Get(0).(func() (*p2p.Endpoint, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() *p2p.Endpoint); ok { r0 = rf() } else { @@ -95,7 +105,6 @@ func (_m *Transport) Endpoint() (*p2p.Endpoint, error) { } } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { diff --git a/internal/state/indexer/mocks/event_sink.go b/internal/state/indexer/mocks/event_sink.go index 0c7cf86df9..c62ad7ee7d 100644 --- a/internal/state/indexer/mocks/event_sink.go +++ b/internal/state/indexer/mocks/event_sink.go @@ -25,6 +25,10 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { ret := _m.Called(_a0) var r0 *types.TxResult + var r1 error + if rf, ok := ret.Get(0).(func([]byte) (*types.TxResult, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func([]byte) *types.TxResult); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *EventSink) GetTxByHash(_a0 []byte) (*types.TxResult, error) { } } - var r1 error if rf, ok := ret.Get(1).(func([]byte) error); ok { r1 = rf(_a0) } else { @@ -48,13 +51,16 @@ func (_m *EventSink) HasBlock(_a0 int64) (bool, error) { ret := _m.Called(_a0) var r0 bool + var r1 error + if rf, ok := ret.Get(0).(func(int64) (bool, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) bool); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(bool) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -97,6 +103,10 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ ret := _m.Called(_a0, _a1) var r0 []int64 + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]int64, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []int64); ok { r0 = rf(_a0, _a1) } else { @@ -105,7 +115,6 @@ func (_m *EventSink) SearchBlockEvents(_a0 context.Context, _a1 *query.Query) ([ } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { r1 = rf(_a0, _a1) } else { @@ -120,6 +129,10 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t ret := _m.Called(_a0, _a1) var r0 []*types.TxResult + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *query.Query) ([]*types.TxResult, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, *query.Query) []*types.TxResult); ok { r0 = rf(_a0, _a1) } else { @@ -128,7 +141,6 @@ func (_m *EventSink) SearchTxEvents(_a0 context.Context, _a1 *query.Query) ([]*t } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *query.Query) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/internal/state/mocks/block_store.go b/internal/state/mocks/block_store.go index 978552dabd..e4e2bb4aed 100644 --- a/internal/state/mocks/block_store.go +++ b/internal/state/mocks/block_store.go @@ -204,13 +204,16 @@ func (_m *BlockStore) PruneBlocks(height int64) (uint64, error) { ret := _m.Called(height) var r0 uint64 + var r1 error + if rf, ok := ret.Get(0).(func(int64) (uint64, error)); ok { + return rf(height) + } if rf, ok := ret.Get(0).(func(int64) uint64); ok { r0 = rf(height) } else { r0 = ret.Get(0).(uint64) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(height) } else { diff --git a/internal/state/mocks/evidence_pool.go b/internal/state/mocks/evidence_pool.go index aa7c7b3364..4d90d986a5 100644 --- a/internal/state/mocks/evidence_pool.go +++ b/internal/state/mocks/evidence_pool.go @@ -49,6 +49,10 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 ret := _m.Called(maxBytes) var r0 []types.Evidence + var r1 int64 + if rf, ok := ret.Get(0).(func(int64) ([]types.Evidence, int64)); ok { + return rf(maxBytes) + } if rf, ok := ret.Get(0).(func(int64) []types.Evidence); ok { r0 = rf(maxBytes) } else { @@ -57,7 +61,6 @@ func (_m *EvidencePool) PendingEvidence(maxBytes int64) ([]types.Evidence, int64 } } - var r1 int64 if rf, ok := ret.Get(1).(func(int64) int64); ok { r1 = rf(maxBytes) } else { diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index f00b58a095..086b3f06bf 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -48,13 +48,16 @@ func (_m *Store) Load() (state.State, error) { ret := _m.Called() var r0 state.State + var r1 error + if rf, ok := ret.Get(0).(func() (state.State, error)); ok { + return rf() + } if rf, ok := ret.Get(0).(func() state.State); ok { r0 = rf() } else { r0 = ret.Get(0).(state.State) } - var r1 error if rf, ok := ret.Get(1).(func() error); ok { r1 = rf() } else { @@ -69,6 +72,10 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e ret := _m.Called(_a0) var r0 *tendermintstate.ABCIResponses + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*tendermintstate.ABCIResponses, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) *tendermintstate.ABCIResponses); ok { r0 = rf(_a0) } else { @@ -77,7 +84,6 @@ func (_m *Store) LoadABCIResponses(_a0 int64) (*tendermintstate.ABCIResponses, e } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -92,13 +98,16 @@ func (_m *Store) LoadConsensusParams(_a0 int64) (types.ConsensusParams, error) { ret := _m.Called(_a0) var r0 types.ConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(int64) (types.ConsensusParams, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) types.ConsensusParams); ok { r0 = rf(_a0) } else { r0 = ret.Get(0).(types.ConsensusParams) } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { @@ -113,6 +122,10 @@ func (_m *Store) LoadValidators(_a0 int64) (*types.ValidatorSet, error) { ret := _m.Called(_a0) var r0 *types.ValidatorSet + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*types.ValidatorSet, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(int64) *types.ValidatorSet); ok { r0 = rf(_a0) } else { @@ -121,7 +134,6 @@ func (_m *Store) LoadValidators(_a0 int64) (*types.ValidatorSet, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(_a0) } else { diff --git a/internal/statesync/mocks/state_provider.go b/internal/statesync/mocks/state_provider.go index 23d1ea23d0..108ae499bc 100644 --- a/internal/statesync/mocks/state_provider.go +++ b/internal/statesync/mocks/state_provider.go @@ -24,6 +24,10 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB ret := _m.Called(ctx, height) var r0 bytes.HexBytes + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (bytes.HexBytes, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) bytes.HexBytes); ok { r0 = rf(ctx, height) } else { @@ -32,7 +36,6 @@ func (_m *StateProvider) AppHash(ctx context.Context, height uint64) (bytes.HexB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { @@ -47,6 +50,10 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm ret := _m.Called(ctx, height) var r0 *types.Commit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (*types.Commit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) *types.Commit); ok { r0 = rf(ctx, height) } else { @@ -55,7 +62,6 @@ func (_m *StateProvider) Commit(ctx context.Context, height uint64) (*types.Comm } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { @@ -70,13 +76,16 @@ func (_m *StateProvider) State(ctx context.Context, height uint64) (state.State, ret := _m.Called(ctx, height) var r0 state.State + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint64) (state.State, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, uint64) state.State); ok { r0 = rf(ctx, height) } else { r0 = ret.Get(0).(state.State) } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint64) error); ok { r1 = rf(ctx, height) } else { diff --git a/light/provider/mocks/provider.go b/light/provider/mocks/provider.go index d77418303a..dd6a7487a7 100644 --- a/light/provider/mocks/provider.go +++ b/light/provider/mocks/provider.go @@ -34,6 +34,10 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB ret := _m.Called(ctx, height) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64) (*types.LightBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, int64) *types.LightBlock); ok { r0 = rf(ctx, height) } else { @@ -42,7 +46,6 @@ func (_m *Provider) LightBlock(ctx context.Context, height int64) (*types.LightB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64) error); ok { r1 = rf(ctx, height) } else { diff --git a/light/rpc/mocks/light_client.go b/light/rpc/mocks/light_client.go index 439ce31ea7..117df9f2bf 100644 --- a/light/rpc/mocks/light_client.go +++ b/light/rpc/mocks/light_client.go @@ -52,6 +52,10 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error ret := _m.Called(height) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(int64) (*types.LightBlock, error)); ok { + return rf(height) + } if rf, ok := ret.Get(0).(func(int64) *types.LightBlock); ok { r0 = rf(height) } else { @@ -60,7 +64,6 @@ func (_m *LightClient) TrustedLightBlock(height int64) (*types.LightBlock, error } } - var r1 error if rf, ok := ret.Get(1).(func(int64) error); ok { r1 = rf(height) } else { @@ -75,6 +78,10 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB ret := _m.Called(ctx, now) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, time.Time) (*types.LightBlock, error)); ok { + return rf(ctx, now) + } if rf, ok := ret.Get(0).(func(context.Context, time.Time) *types.LightBlock); ok { r0 = rf(ctx, now) } else { @@ -83,7 +90,6 @@ func (_m *LightClient) Update(ctx context.Context, now time.Time) (*types.LightB } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, time.Time) error); ok { r1 = rf(ctx, now) } else { @@ -98,6 +104,10 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 ret := _m.Called(ctx, height, now) var r0 *types.LightBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) (*types.LightBlock, error)); ok { + return rf(ctx, height, now) + } if rf, ok := ret.Get(0).(func(context.Context, int64, time.Time) *types.LightBlock); ok { r0 = rf(ctx, height, now) } else { @@ -106,7 +116,6 @@ func (_m *LightClient) VerifyLightBlockAtHeight(ctx context.Context, height int6 } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, time.Time) error); ok { r1 = rf(ctx, height, now) } else { diff --git a/networks/remote/ansible/roles/logzio/tasks/main.yml b/networks/remote/ansible/roles/logzio/tasks/main.yml index 580c81e8a8..6aa1b4eb2a 100644 --- a/networks/remote/ansible/roles/logzio/tasks/main.yml +++ b/networks/remote/ansible/roles/logzio/tasks/main.yml @@ -6,10 +6,10 @@ - name: Create folders file: "path={{item}} state=directory recurse=yes" with_items: - - /etc/journalbeat - - /etc/pki/tls/certs - - /usr/share/journalbeat - - /var/log/journalbeat + - /etc/journalbeat + - /etc/pki/tls/certs + - /usr/share/journalbeat + - /var/log/journalbeat - name: Copy journalbeat config template: src=journalbeat.yml.j2 dest=/etc/journalbeat/journalbeat.yml mode=0600 @@ -21,5 +21,5 @@ - name: Copy journalbeat service config copy: src=journalbeat.service dest=/etc/systemd/system/journalbeat.service notify: - - reload daemon - - restart journalbeat + - reload daemon + - restart journalbeat diff --git a/proto/tendermint/crypto/keys.pb.go b/proto/tendermint/crypto/keys.pb.go index cb56a39b2d..35b568c62a 100644 --- a/proto/tendermint/crypto/keys.pb.go +++ b/proto/tendermint/crypto/keys.pb.go @@ -27,6 +27,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // PublicKey defines the keys available for use with Tendermint Validators type PublicKey struct { // Types that are valid to be assigned to Sum: + // // *PublicKey_Ed25519 // *PublicKey_Secp256K1 // *PublicKey_Bls12381 diff --git a/proto/tendermint/p2p/conn.pb.go b/proto/tendermint/p2p/conn.pb.go index 47a3bb0cd8..16ee463a6a 100644 --- a/proto/tendermint/p2p/conn.pb.go +++ b/proto/tendermint/p2p/conn.pb.go @@ -158,6 +158,7 @@ func (m *PacketMsg) GetData() []byte { type Packet struct { // Types that are valid to be assigned to Sum: + // // *Packet_PacketPing // *Packet_PacketPong // *Packet_PacketMsg diff --git a/proto/tendermint/p2p/types.pb.go b/proto/tendermint/p2p/types.pb.go index 652951e31e..937d2b1427 100644 --- a/proto/tendermint/p2p/types.pb.go +++ b/proto/tendermint/p2p/types.pb.go @@ -443,6 +443,7 @@ func (m *Echo) GetValue() string { type Envelope struct { Attributes map[string]string `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // Types that are valid to be assigned to Sum: + // // *Envelope_Echo // *Envelope_PexRequest // *Envelope_PexResponse diff --git a/proto/tendermint/p2p/types.proto b/proto/tendermint/p2p/types.proto index 347f8f8393..5c8d2fa7ce 100644 --- a/proto/tendermint/p2p/types.proto +++ b/proto/tendermint/p2p/types.proto @@ -58,11 +58,11 @@ message Envelope { map attributes = 1; oneof sum { - Echo echo = 2; - tendermint.p2p.PexRequest pex_request = 3; - tendermint.p2p.PexResponse pex_response = 4; - tendermint.types.Evidence evidence = 5; - tendermint.mempool.Txs mempool_txs = 6; + Echo echo = 2; + tendermint.p2p.PexRequest pex_request = 3; + tendermint.p2p.PexResponse pex_response = 4; + tendermint.types.Evidence evidence = 5; + tendermint.mempool.Txs mempool_txs = 6; tendermint.blocksync.BlockRequest block_request = 7; tendermint.blocksync.NoBlockResponse no_block_response = 8; diff --git a/rpc/client/mocks/abci_client.go b/rpc/client/mocks/abci_client.go index 76587a0775..504c4efd87 100644 --- a/rpc/client/mocks/abci_client.go +++ b/rpc/client/mocks/abci_client.go @@ -25,6 +25,10 @@ func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *ABCIClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -48,6 +51,10 @@ func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.Hex ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -56,7 +63,6 @@ func (_m *ABCIClient) ABCIQuery(ctx context.Context, path string, data bytes.Hex } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -71,6 +77,10 @@ func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, dat ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -79,7 +89,6 @@ func (_m *ABCIClient) ABCIQueryWithOptions(ctx context.Context, path string, dat } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -94,6 +103,10 @@ func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -102,7 +115,6 @@ func (_m *ABCIClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -117,6 +129,10 @@ func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*core ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -125,7 +141,6 @@ func (_m *ABCIClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*core } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -140,6 +155,10 @@ func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*cor ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -148,7 +167,6 @@ func (_m *ABCIClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -163,6 +181,10 @@ func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coret ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -171,7 +193,6 @@ func (_m *ABCIClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/client.go b/rpc/client/mocks/client.go index 7c485c425d..daf2207c8b 100644 --- a/rpc/client/mocks/client.go +++ b/rpc/client/mocks/client.go @@ -25,6 +25,10 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *Client) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo, erro } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -48,6 +51,10 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -56,7 +63,6 @@ func (_m *Client) ABCIQuery(ctx context.Context, path string, data bytes.HexByte } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -71,6 +77,10 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -79,7 +89,6 @@ func (_m *Client) ABCIQueryWithOptions(ctx context.Context, path string, data by } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -94,6 +103,10 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -102,7 +115,6 @@ func (_m *Client) Block(ctx context.Context, height *int64) (*coretypes.ResultBl } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -117,6 +129,10 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -125,7 +141,6 @@ func (_m *Client) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*corety } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -140,6 +155,10 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -148,7 +167,6 @@ func (_m *Client) BlockResults(ctx context.Context, height *int64) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -163,6 +181,10 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return rf(ctx, query, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -171,7 +193,6 @@ func (_m *Client) BlockSearch(ctx context.Context, query string, page *int, perP } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -186,6 +207,10 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return rf(ctx, minHeight, maxHeight) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -194,7 +219,6 @@ func (_m *Client) BlockchainInfo(ctx context.Context, minHeight int64, maxHeight } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -209,6 +233,10 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -217,7 +245,6 @@ func (_m *Client) BroadcastEvidence(_a0 context.Context, _a1 types.Evidence) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { @@ -232,6 +259,10 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -240,7 +271,6 @@ func (_m *Client) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -255,6 +285,10 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -263,7 +297,6 @@ func (_m *Client) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*coretype } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -278,6 +311,10 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -286,7 +323,6 @@ func (_m *Client) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -301,6 +337,10 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -309,7 +349,6 @@ func (_m *Client) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*coretypes } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -324,6 +363,10 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -332,7 +375,6 @@ func (_m *Client) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.ResultC } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -347,6 +389,10 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -355,7 +401,6 @@ func (_m *Client) Commit(ctx context.Context, height *int64) (*coretypes.ResultC } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -370,6 +415,10 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -378,7 +427,6 @@ func (_m *Client) ConsensusParams(ctx context.Context, height *int64) (*coretype } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -393,6 +441,10 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -401,7 +453,6 @@ func (_m *Client) ConsensusState(_a0 context.Context) (*coretypes.ResultConsensu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -416,6 +467,10 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -424,7 +479,6 @@ func (_m *Client) DumpConsensusState(_a0 context.Context) (*coretypes.ResultDump } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -439,6 +493,10 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -447,7 +505,6 @@ func (_m *Client) Events(ctx context.Context, req *coretypes.RequestEvents) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { @@ -462,6 +519,10 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -470,7 +531,6 @@ func (_m *Client) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -485,6 +545,10 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -493,7 +557,6 @@ func (_m *Client) GenesisChunked(_a0 context.Context, _a1 uint) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { @@ -508,6 +571,10 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -516,7 +583,6 @@ func (_m *Client) Header(ctx context.Context, height *int64) (*coretypes.ResultH } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -531,6 +597,10 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -539,7 +609,6 @@ func (_m *Client) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*coret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -554,6 +623,10 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { ret := _m.Called(_a0) var r0 *coretypes.ResultHealth + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -562,7 +635,6 @@ func (_m *Client) Health(_a0 context.Context) (*coretypes.ResultHealth, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -577,6 +649,10 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -585,7 +661,6 @@ func (_m *Client) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, error) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -600,6 +675,10 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -608,7 +687,6 @@ func (_m *Client) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.ResultUncon } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -651,6 +729,10 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { ret := _m.Called(_a0) var r0 *coretypes.ResultStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -659,7 +741,6 @@ func (_m *Client) Status(_a0 context.Context) (*coretypes.ResultStatus, error) { } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -681,6 +762,10 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return rf(ctx, subscriber, query, outCapacity...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -689,7 +774,6 @@ func (_m *Client) Subscribe(ctx context.Context, subscriber string, query string } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -704,6 +788,10 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return rf(ctx, hash, prove) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -712,7 +800,6 @@ func (_m *Client) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -727,6 +814,10 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return rf(ctx, query, prove, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -735,7 +826,6 @@ func (_m *Client) TxSearch(ctx context.Context, query string, prove bool, page * } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -750,6 +840,10 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(ctx, page, perPage) + } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -758,7 +852,6 @@ func (_m *Client) UnconfirmedTxs(ctx context.Context, page *int, perPage *int) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { @@ -801,6 +894,10 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return rf(ctx, height, page, perPage, requestQuorumInfo) + } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -809,7 +906,6 @@ func (_m *Client) Validators(ctx context.Context, height *int64, page *int, perP } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/events_client.go b/rpc/client/mocks/events_client.go index 19b882552f..0e158f9cd2 100644 --- a/rpc/client/mocks/events_client.go +++ b/rpc/client/mocks/events_client.go @@ -19,6 +19,10 @@ func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -27,7 +31,6 @@ func (_m *EventsClient) Events(ctx context.Context, req *coretypes.RequestEvents } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { diff --git a/rpc/client/mocks/evidence_client.go b/rpc/client/mocks/evidence_client.go index 3b8d3cf2ed..9c95244d2d 100644 --- a/rpc/client/mocks/evidence_client.go +++ b/rpc/client/mocks/evidence_client.go @@ -21,6 +21,10 @@ func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evide ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -29,7 +33,6 @@ func (_m *EvidenceClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evide } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/history_client.go b/rpc/client/mocks/history_client.go index ae28fe69b2..3e7d6f0541 100644 --- a/rpc/client/mocks/history_client.go +++ b/rpc/client/mocks/history_client.go @@ -19,6 +19,10 @@ func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, ma ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return rf(ctx, minHeight, maxHeight) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -27,7 +31,6 @@ func (_m *HistoryClient) BlockchainInfo(ctx context.Context, minHeight int64, ma } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -42,6 +45,10 @@ func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -50,7 +57,6 @@ func (_m *HistoryClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -65,6 +71,10 @@ func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -73,7 +83,6 @@ func (_m *HistoryClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { diff --git a/rpc/client/mocks/mempool_client.go b/rpc/client/mocks/mempool_client.go index 714c66c6d4..3ac15fc2eb 100644 --- a/rpc/client/mocks/mempool_client.go +++ b/rpc/client/mocks/mempool_client.go @@ -21,6 +21,10 @@ func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes. ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -29,7 +33,6 @@ func (_m *MempoolClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes. } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -44,6 +47,10 @@ func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resu ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -52,7 +59,6 @@ func (_m *MempoolClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -81,6 +87,10 @@ func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(ctx, page, perPage) + } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -89,7 +99,6 @@ func (_m *MempoolClient) UnconfirmedTxs(ctx context.Context, page *int, perPage } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { diff --git a/rpc/client/mocks/network_client.go b/rpc/client/mocks/network_client.go index d0f7eaa559..d09b3c8dcf 100644 --- a/rpc/client/mocks/network_client.go +++ b/rpc/client/mocks/network_client.go @@ -19,6 +19,10 @@ func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*c ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -27,7 +31,6 @@ func (_m *NetworkClient) ConsensusParams(ctx context.Context, height *int64) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -42,6 +45,10 @@ func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultC ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -50,7 +57,6 @@ func (_m *NetworkClient) ConsensusState(_a0 context.Context) (*coretypes.ResultC } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -65,6 +71,10 @@ func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.Res ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -73,7 +83,6 @@ func (_m *NetworkClient) DumpConsensusState(_a0 context.Context) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -88,6 +97,10 @@ func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, e ret := _m.Called(_a0) var r0 *coretypes.ResultHealth + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -96,7 +109,6 @@ func (_m *NetworkClient) Health(_a0 context.Context) (*coretypes.ResultHealth, e } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -111,6 +123,10 @@ func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -119,7 +135,6 @@ func (_m *NetworkClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/rpc/client/mocks/remote_client.go b/rpc/client/mocks/remote_client.go index 029c712034..ddb932981c 100644 --- a/rpc/client/mocks/remote_client.go +++ b/rpc/client/mocks/remote_client.go @@ -25,6 +25,10 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo ret := _m.Called(_a0) var r0 *coretypes.ResultABCIInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultABCIInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultABCIInfo); ok { r0 = rf(_a0) } else { @@ -33,7 +37,6 @@ func (_m *RemoteClient) ABCIInfo(_a0 context.Context) (*coretypes.ResultABCIInfo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -48,6 +51,10 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H ret := _m.Called(ctx, path, data) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data) } else { @@ -56,7 +63,6 @@ func (_m *RemoteClient) ABCIQuery(ctx context.Context, path string, data bytes.H } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes) error); ok { r1 = rf(ctx, path, data) } else { @@ -71,6 +77,10 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d ret := _m.Called(ctx, path, data, opts) var r0 *coretypes.ResultABCIQuery + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) (*coretypes.ResultABCIQuery, error)); ok { + return rf(ctx, path, data, opts) + } if rf, ok := ret.Get(0).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) *coretypes.ResultABCIQuery); ok { r0 = rf(ctx, path, data, opts) } else { @@ -79,7 +89,6 @@ func (_m *RemoteClient) ABCIQueryWithOptions(ctx context.Context, path string, d } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bytes.HexBytes, client.ABCIQueryOptions) error); ok { r1 = rf(ctx, path, data, opts) } else { @@ -94,6 +103,10 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -102,7 +115,6 @@ func (_m *RemoteClient) Block(ctx context.Context, height *int64) (*coretypes.Re } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -117,6 +129,10 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -125,7 +141,6 @@ func (_m *RemoteClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (* } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -140,6 +155,10 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -148,7 +167,6 @@ func (_m *RemoteClient) BlockResults(ctx context.Context, height *int64) (*coret } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -163,6 +181,10 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return rf(ctx, query, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -171,7 +193,6 @@ func (_m *RemoteClient) BlockSearch(ctx context.Context, query string, page *int } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -186,6 +207,10 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max ret := _m.Called(ctx, minHeight, maxHeight) var r0 *coretypes.ResultBlockchainInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, int64, int64) (*coretypes.ResultBlockchainInfo, error)); ok { + return rf(ctx, minHeight, maxHeight) + } if rf, ok := ret.Get(0).(func(context.Context, int64, int64) *coretypes.ResultBlockchainInfo); ok { r0 = rf(ctx, minHeight, maxHeight) } else { @@ -194,7 +219,6 @@ func (_m *RemoteClient) BlockchainInfo(ctx context.Context, minHeight int64, max } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, int64, int64) error); ok { r1 = rf(ctx, minHeight, maxHeight) } else { @@ -209,6 +233,10 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastEvidence + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) (*coretypes.ResultBroadcastEvidence, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Evidence) *coretypes.ResultBroadcastEvidence); ok { r0 = rf(_a0, _a1) } else { @@ -217,7 +245,6 @@ func (_m *RemoteClient) BroadcastEvidence(_a0 context.Context, _a1 types.Evidenc } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Evidence) error); ok { r1 = rf(_a0, _a1) } else { @@ -232,6 +259,10 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -240,7 +271,6 @@ func (_m *RemoteClient) BroadcastTx(_a0 context.Context, _a1 types.Tx) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -255,6 +285,10 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -263,7 +297,6 @@ func (_m *RemoteClient) BroadcastTxAsync(_a0 context.Context, _a1 types.Tx) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -278,6 +311,10 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTxCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTxCommit, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTxCommit); ok { r0 = rf(_a0, _a1) } else { @@ -286,7 +323,6 @@ func (_m *RemoteClient) BroadcastTxCommit(_a0 context.Context, _a1 types.Tx) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -301,6 +337,10 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultBroadcastTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultBroadcastTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultBroadcastTx); ok { r0 = rf(_a0, _a1) } else { @@ -309,7 +349,6 @@ func (_m *RemoteClient) BroadcastTxSync(_a0 context.Context, _a1 types.Tx) (*cor } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -324,6 +363,10 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultCheckTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, types.Tx) (*coretypes.ResultCheckTx, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, types.Tx) *coretypes.ResultCheckTx); ok { r0 = rf(_a0, _a1) } else { @@ -332,7 +375,6 @@ func (_m *RemoteClient) CheckTx(_a0 context.Context, _a1 types.Tx) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, types.Tx) error); ok { r1 = rf(_a0, _a1) } else { @@ -347,6 +389,10 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -355,7 +401,6 @@ func (_m *RemoteClient) Commit(ctx context.Context, height *int64) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -370,6 +415,10 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co ret := _m.Called(ctx, height) var r0 *coretypes.ResultConsensusParams + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultConsensusParams, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultConsensusParams); ok { r0 = rf(ctx, height) } else { @@ -378,7 +427,6 @@ func (_m *RemoteClient) ConsensusParams(ctx context.Context, height *int64) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -393,6 +441,10 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo ret := _m.Called(_a0) var r0 *coretypes.ResultConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultConsensusState); ok { r0 = rf(_a0) } else { @@ -401,7 +453,6 @@ func (_m *RemoteClient) ConsensusState(_a0 context.Context) (*coretypes.ResultCo } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -416,6 +467,10 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu ret := _m.Called(_a0) var r0 *coretypes.ResultDumpConsensusState + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultDumpConsensusState, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultDumpConsensusState); ok { r0 = rf(_a0) } else { @@ -424,7 +479,6 @@ func (_m *RemoteClient) DumpConsensusState(_a0 context.Context) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -439,6 +493,10 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents ret := _m.Called(ctx, req) var r0 *coretypes.ResultEvents + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) (*coretypes.ResultEvents, error)); ok { + return rf(ctx, req) + } if rf, ok := ret.Get(0).(func(context.Context, *coretypes.RequestEvents) *coretypes.ResultEvents); ok { r0 = rf(ctx, req) } else { @@ -447,7 +505,6 @@ func (_m *RemoteClient) Events(ctx context.Context, req *coretypes.RequestEvents } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *coretypes.RequestEvents) error); ok { r1 = rf(ctx, req) } else { @@ -462,6 +519,10 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, ret := _m.Called(_a0) var r0 *coretypes.ResultGenesis + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultGenesis, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultGenesis); ok { r0 = rf(_a0) } else { @@ -470,7 +531,6 @@ func (_m *RemoteClient) Genesis(_a0 context.Context) (*coretypes.ResultGenesis, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -485,6 +545,10 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype ret := _m.Called(_a0, _a1) var r0 *coretypes.ResultGenesisChunk + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, uint) (*coretypes.ResultGenesisChunk, error)); ok { + return rf(_a0, _a1) + } if rf, ok := ret.Get(0).(func(context.Context, uint) *coretypes.ResultGenesisChunk); ok { r0 = rf(_a0, _a1) } else { @@ -493,7 +557,6 @@ func (_m *RemoteClient) GenesisChunked(_a0 context.Context, _a1 uint) (*coretype } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, uint) error); ok { r1 = rf(_a0, _a1) } else { @@ -508,6 +571,10 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -516,7 +583,6 @@ func (_m *RemoteClient) Header(ctx context.Context, height *int64) (*coretypes.R } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -531,6 +597,10 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -539,7 +609,6 @@ func (_m *RemoteClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -554,6 +623,10 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er ret := _m.Called(_a0) var r0 *coretypes.ResultHealth + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultHealth, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultHealth); ok { r0 = rf(_a0) } else { @@ -562,7 +635,6 @@ func (_m *RemoteClient) Health(_a0 context.Context) (*coretypes.ResultHealth, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -577,6 +649,10 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, ret := _m.Called(_a0) var r0 *coretypes.ResultNetInfo + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultNetInfo, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultNetInfo); ok { r0 = rf(_a0) } else { @@ -585,7 +661,6 @@ func (_m *RemoteClient) NetInfo(_a0 context.Context) (*coretypes.ResultNetInfo, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -600,6 +675,10 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul ret := _m.Called(_a0) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(_a0) } else { @@ -608,7 +687,6 @@ func (_m *RemoteClient) NumUnconfirmedTxs(_a0 context.Context) (*coretypes.Resul } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -665,6 +743,10 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er ret := _m.Called(_a0) var r0 *coretypes.ResultStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -673,7 +755,6 @@ func (_m *RemoteClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { @@ -695,6 +776,10 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return rf(ctx, subscriber, query, outCapacity...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -703,7 +788,6 @@ func (_m *RemoteClient) Subscribe(ctx context.Context, subscriber string, query } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -718,6 +802,10 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return rf(ctx, hash, prove) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -726,7 +814,6 @@ func (_m *RemoteClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -741,6 +828,10 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return rf(ctx, query, prove, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -749,7 +840,6 @@ func (_m *RemoteClient) TxSearch(ctx context.Context, query string, prove bool, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -764,6 +854,10 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * ret := _m.Called(ctx, page, perPage) var r0 *coretypes.ResultUnconfirmedTxs + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int, *int) (*coretypes.ResultUnconfirmedTxs, error)); ok { + return rf(ctx, page, perPage) + } if rf, ok := ret.Get(0).(func(context.Context, *int, *int) *coretypes.ResultUnconfirmedTxs); ok { r0 = rf(ctx, page, perPage) } else { @@ -772,7 +866,6 @@ func (_m *RemoteClient) UnconfirmedTxs(ctx context.Context, page *int, perPage * } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int, *int) error); ok { r1 = rf(ctx, page, perPage) } else { @@ -815,6 +908,10 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return rf(ctx, height, page, perPage, requestQuorumInfo) + } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -823,7 +920,6 @@ func (_m *RemoteClient) Validators(ctx context.Context, height *int64, page *int } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/sign_client.go b/rpc/client/mocks/sign_client.go index 008176295a..aa192a75c3 100644 --- a/rpc/client/mocks/sign_client.go +++ b/rpc/client/mocks/sign_client.go @@ -22,6 +22,10 @@ func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.Resu ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlock); ok { r0 = rf(ctx, height) } else { @@ -30,7 +34,6 @@ func (_m *SignClient) Block(ctx context.Context, height *int64) (*coretypes.Resu } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -45,6 +48,10 @@ func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*co ret := _m.Called(ctx, hash) var r0 *coretypes.ResultBlock + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultBlock, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultBlock); ok { r0 = rf(ctx, hash) } else { @@ -53,7 +60,6 @@ func (_m *SignClient) BlockByHash(ctx context.Context, hash bytes.HexBytes) (*co } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -68,6 +74,10 @@ func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretyp ret := _m.Called(ctx, height) var r0 *coretypes.ResultBlockResults + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultBlockResults, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultBlockResults); ok { r0 = rf(ctx, height) } else { @@ -76,7 +86,6 @@ func (_m *SignClient) BlockResults(ctx context.Context, height *int64) (*coretyp } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -91,6 +100,10 @@ func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, ret := _m.Called(ctx, query, page, perPage, orderBy) var r0 *coretypes.ResultBlockSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) (*coretypes.ResultBlockSearch, error)); ok { + return rf(ctx, query, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, *int, *int, string) *coretypes.ResultBlockSearch); ok { r0 = rf(ctx, query, page, perPage, orderBy) } else { @@ -99,7 +112,6 @@ func (_m *SignClient) BlockSearch(ctx context.Context, query string, page *int, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, *int, *int, string) error); ok { r1 = rf(ctx, query, page, perPage, orderBy) } else { @@ -114,6 +126,10 @@ func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.Res ret := _m.Called(ctx, height) var r0 *coretypes.ResultCommit + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultCommit, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultCommit); ok { r0 = rf(ctx, height) } else { @@ -122,7 +138,6 @@ func (_m *SignClient) Commit(ctx context.Context, height *int64) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -137,6 +152,10 @@ func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.Res ret := _m.Called(ctx, height) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, height) + } if rf, ok := ret.Get(0).(func(context.Context, *int64) *coretypes.ResultHeader); ok { r0 = rf(ctx, height) } else { @@ -145,7 +164,6 @@ func (_m *SignClient) Header(ctx context.Context, height *int64) (*coretypes.Res } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64) error); ok { r1 = rf(ctx, height) } else { @@ -160,6 +178,10 @@ func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*c ret := _m.Called(ctx, hash) var r0 *coretypes.ResultHeader + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) (*coretypes.ResultHeader, error)); ok { + return rf(ctx, hash) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes) *coretypes.ResultHeader); ok { r0 = rf(ctx, hash) } else { @@ -168,7 +190,6 @@ func (_m *SignClient) HeaderByHash(ctx context.Context, hash bytes.HexBytes) (*c } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes) error); ok { r1 = rf(ctx, hash) } else { @@ -183,6 +204,10 @@ func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ( ret := _m.Called(ctx, hash, prove) var r0 *coretypes.ResultTx + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) (*coretypes.ResultTx, error)); ok { + return rf(ctx, hash, prove) + } if rf, ok := ret.Get(0).(func(context.Context, bytes.HexBytes, bool) *coretypes.ResultTx); ok { r0 = rf(ctx, hash, prove) } else { @@ -191,7 +216,6 @@ func (_m *SignClient) Tx(ctx context.Context, hash bytes.HexBytes, prove bool) ( } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, bytes.HexBytes, bool) error); ok { r1 = rf(ctx, hash, prove) } else { @@ -206,6 +230,10 @@ func (_m *SignClient) TxSearch(ctx context.Context, query string, prove bool, pa ret := _m.Called(ctx, query, prove, page, perPage, orderBy) var r0 *coretypes.ResultTxSearch + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) (*coretypes.ResultTxSearch, error)); ok { + return rf(ctx, query, prove, page, perPage, orderBy) + } if rf, ok := ret.Get(0).(func(context.Context, string, bool, *int, *int, string) *coretypes.ResultTxSearch); ok { r0 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -214,7 +242,6 @@ func (_m *SignClient) TxSearch(ctx context.Context, query string, prove bool, pa } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, bool, *int, *int, string) error); ok { r1 = rf(ctx, query, prove, page, perPage, orderBy) } else { @@ -229,6 +256,10 @@ func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, ret := _m.Called(ctx, height, page, perPage, requestQuorumInfo) var r0 *coretypes.ResultValidators + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) (*coretypes.ResultValidators, error)); ok { + return rf(ctx, height, page, perPage, requestQuorumInfo) + } if rf, ok := ret.Get(0).(func(context.Context, *int64, *int, *int, *bool) *coretypes.ResultValidators); ok { r0 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { @@ -237,7 +268,6 @@ func (_m *SignClient) Validators(ctx context.Context, height *int64, page *int, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, *int64, *int, *int, *bool) error); ok { r1 = rf(ctx, height, page, perPage, requestQuorumInfo) } else { diff --git a/rpc/client/mocks/status_client.go b/rpc/client/mocks/status_client.go index bf22efa207..801bd3112c 100644 --- a/rpc/client/mocks/status_client.go +++ b/rpc/client/mocks/status_client.go @@ -19,6 +19,10 @@ func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er ret := _m.Called(_a0) var r0 *coretypes.ResultStatus + var r1 error + if rf, ok := ret.Get(0).(func(context.Context) (*coretypes.ResultStatus, error)); ok { + return rf(_a0) + } if rf, ok := ret.Get(0).(func(context.Context) *coretypes.ResultStatus); ok { r0 = rf(_a0) } else { @@ -27,7 +31,6 @@ func (_m *StatusClient) Status(_a0 context.Context) (*coretypes.ResultStatus, er } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(_a0) } else { diff --git a/rpc/client/mocks/subscription_client.go b/rpc/client/mocks/subscription_client.go index c476a4fc7a..580809a8e1 100644 --- a/rpc/client/mocks/subscription_client.go +++ b/rpc/client/mocks/subscription_client.go @@ -26,6 +26,10 @@ func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, ret := _m.Called(_ca...) var r0 <-chan coretypes.ResultEvent + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) (<-chan coretypes.ResultEvent, error)); ok { + return rf(ctx, subscriber, query, outCapacity...) + } if rf, ok := ret.Get(0).(func(context.Context, string, string, ...int) <-chan coretypes.ResultEvent); ok { r0 = rf(ctx, subscriber, query, outCapacity...) } else { @@ -34,7 +38,6 @@ func (_m *SubscriptionClient) Subscribe(ctx context.Context, subscriber string, } } - var r1 error if rf, ok := ret.Get(1).(func(context.Context, string, string, ...int) error); ok { r1 = rf(ctx, subscriber, query, outCapacity...) } else {