build(deps): bump cometbft to v1.0.0-rc2 (#22577)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
This commit is contained in:
co-authored by
marbar3778
parent
300348fe53
commit
ca48cef255
@@ -36,8 +36,10 @@ Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.j
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [v1.0.0-rc.2] - 2024-11-26
|
||||
|
||||
* [#22577](https://github.com/cosmos/cosmos-sdk/pull/22577) Support invalid RPC response for CometBFT v1
|
||||
|
||||
## [v1.0.0-rc.1] - 2024-11-26
|
||||
|
||||
### Features
|
||||
|
||||
* [#22578](https://github.com/cosmos/cosmos-sdk/pull/22578) Extract system test framework
|
||||
|
||||
+44
-23
@@ -27,17 +27,18 @@ type (
|
||||
|
||||
// CLIWrapper provides a more convenient way to interact with the CLI binary from the Go tests
|
||||
type CLIWrapper struct {
|
||||
t *testing.T
|
||||
nodeAddress string
|
||||
chainID string
|
||||
homeDir string
|
||||
fees string
|
||||
Debug bool
|
||||
assertErrorFn RunErrorAssert
|
||||
awaitNextBlock awaitNextBlock
|
||||
expTXCommitted bool
|
||||
execBinary string
|
||||
nodesCount int
|
||||
t *testing.T
|
||||
nodeAddress string
|
||||
chainID string
|
||||
homeDir string
|
||||
fees string
|
||||
Debug bool
|
||||
assertErrorFn RunErrorAssert
|
||||
awaitNextBlock awaitNextBlock
|
||||
expTXCommitted bool
|
||||
execBinary string
|
||||
nodesCount int
|
||||
runSingleOutput bool
|
||||
}
|
||||
|
||||
// NewCLIWrapper constructor
|
||||
@@ -54,6 +55,7 @@ func NewCLIWrapper(t *testing.T, sut *SystemUnderTest, verbose bool) *CLIWrapper
|
||||
"1"+sdk.DefaultBondDenom,
|
||||
verbose,
|
||||
assert.NoError,
|
||||
false,
|
||||
true,
|
||||
)
|
||||
}
|
||||
@@ -70,6 +72,7 @@ func NewCLIWrapperX(
|
||||
fees string,
|
||||
debug bool,
|
||||
assertErrorFn RunErrorAssert,
|
||||
runSingleOutput bool,
|
||||
expTXCommitted bool,
|
||||
) *CLIWrapper {
|
||||
t.Helper()
|
||||
@@ -77,17 +80,18 @@ func NewCLIWrapperX(
|
||||
t.Fatal("name of executable binary must not be empty")
|
||||
}
|
||||
return &CLIWrapper{
|
||||
t: t,
|
||||
execBinary: execBinary,
|
||||
nodeAddress: nodeAddress,
|
||||
chainID: chainID,
|
||||
homeDir: homeDir,
|
||||
Debug: debug,
|
||||
awaitNextBlock: awaiter,
|
||||
nodesCount: nodesCount,
|
||||
fees: fees,
|
||||
assertErrorFn: assertErrorFn,
|
||||
expTXCommitted: expTXCommitted,
|
||||
t: t,
|
||||
execBinary: execBinary,
|
||||
nodeAddress: nodeAddress,
|
||||
chainID: chainID,
|
||||
homeDir: homeDir,
|
||||
Debug: debug,
|
||||
awaitNextBlock: awaiter,
|
||||
nodesCount: nodesCount,
|
||||
fees: fees,
|
||||
assertErrorFn: assertErrorFn,
|
||||
runSingleOutput: runSingleOutput,
|
||||
expTXCommitted: expTXCommitted,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +109,12 @@ func (c CLIWrapper) WithRunErrorMatcher(f RunErrorAssert) CLIWrapper {
|
||||
})
|
||||
}
|
||||
|
||||
func (c CLIWrapper) WithRunSingleOutput() CLIWrapper {
|
||||
return c.clone(func(r *CLIWrapper) {
|
||||
r.runSingleOutput = true
|
||||
})
|
||||
}
|
||||
|
||||
func (c CLIWrapper) WithNodeAddress(nodeAddr string) CLIWrapper {
|
||||
return c.clone(func(r *CLIWrapper) {
|
||||
r.nodeAddress = nodeAddr
|
||||
@@ -135,6 +145,7 @@ func (c CLIWrapper) clone(mutator ...func(r *CLIWrapper)) CLIWrapper {
|
||||
c.fees,
|
||||
c.Debug,
|
||||
c.assertErrorFn,
|
||||
c.runSingleOutput,
|
||||
c.expTXCommitted,
|
||||
)
|
||||
for _, m := range mutator {
|
||||
@@ -235,6 +246,11 @@ func (c CLIWrapper) runWithInput(args []string, input io.Reader) (output string,
|
||||
cmd := exec.Command(locateExecutable(c.execBinary), args...) //nolint:gosec // test code only
|
||||
cmd.Dir = WorkDir
|
||||
cmd.Stdin = input
|
||||
|
||||
if c.runSingleOutput {
|
||||
return cmd.Output()
|
||||
}
|
||||
|
||||
return cmd.CombinedOutput()
|
||||
}()
|
||||
|
||||
@@ -437,9 +453,14 @@ func RequireTxSuccess(t *testing.T, got string) {
|
||||
require.Equal(t, int64(0), code, "non success tx code : %s", details)
|
||||
}
|
||||
|
||||
// RequireTxFailure require the received response to contain any failure code and the passed msgsgs
|
||||
// RequireTxFailure require the received response to contain any failure code and the passed msgs
|
||||
// From CometBFT v1, an RPC error won't return ABCI response, and error must be parsed
|
||||
func RequireTxFailure(t *testing.T, got string, containsMsgs ...string) {
|
||||
t.Helper()
|
||||
if strings.Contains(got, "broadcast error on transaction validation") {
|
||||
return // tx is invalid, no need to parse
|
||||
}
|
||||
|
||||
code, details := parseResultCode(t, got)
|
||||
require.NotEqual(t, int64(0), code, details)
|
||||
for _, msg := range containsMsgs {
|
||||
|
||||
Reference in New Issue
Block a user