Skip to content

Commit

Permalink
Merge branch 'main' into chandini/client-terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
chandiniv1 authored Aug 21, 2024
2 parents cbc2fe0 + 722320a commit 75fbeaa
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 171 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/callbacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
steps:
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@v2.3.0
uses: SonarSource/sonarcloud-github-action@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/capability.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
steps:
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@v2.3.0
uses: SonarSource/sonarcloud-github-action@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-setup-action@v1.36.0
- uses: bufbuild/buf-setup-action@v1.37.0
- uses: bufbuild/buf-push-action@v1
with:
input: "proto"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
name: '${{ github.sha }}-03-coverage'
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft }}
uses: SonarSource/sonarcloud-github-action@v2.3.0
uses: SonarSource/sonarcloud-github-action@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/wasm-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
steps:
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@v2.3.0
uses: SonarSource/sonarcloud-github-action@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
testCases := []struct {
name string
malleate func()
expPass bool
expErr error
}{
{
"success", func() {}, true,
"success", func() {}, nil,
},
{
"ICA auth module does not claim channel capability", func() {
Expand All @@ -139,7 +139,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {

return version, nil
}
}, true,
}, nil,
},
{
"ICA auth module modification of channel version is ignored", func() {
Expand All @@ -151,12 +151,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
) (string, error) {
return "invalid-version", nil
}
}, true,
}, nil,
},
{
"controller submodule disabled", func() {
suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false))
}, false,
}, types.ErrControllerSubModuleDisabled,
},
{
"ICA auth module callback fails", func() {
Expand All @@ -166,12 +166,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
) (string, error) {
return "", fmt.Errorf("mock ica auth fails")
}
}, false,
}, fmt.Errorf("mock ica auth fails"),
},
{
"nil underlying app", func() {
isNilApp = true
}, true,
}, nil,
},
{
"middleware disabled", func() {
Expand All @@ -183,7 +183,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
) (string, error) {
return "", fmt.Errorf("error should be unreachable")
}
}, true,
}, nil,
},
}

Expand Down Expand Up @@ -242,11 +242,11 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, chanCap, channel.Counterparty, channel.Version,
)

if tc.expPass {
if tc.expErr == nil {
suite.Require().Equal(TestVersion, version)
suite.Require().NoError(err)
} else {
suite.Require().Error(err)
suite.Require().ErrorContains(err, tc.expErr.Error())
}
})
}
Expand Down Expand Up @@ -315,20 +315,20 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() {
testCases := []struct {
name string
malleate func()
expPass bool
expErr error
}{
{
"success", func() {}, true,
"success", func() {}, nil,
},
{
"controller submodule disabled", func() {
suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false))
}, false,
}, types.ErrControllerSubModuleDisabled,
},
{
"ICA OnChanOpenACK fails - invalid version", func() {
path.EndpointB.ChannelConfig.Version = invalidVersion
}, false,
}, ibcerrors.ErrInvalidType,
},
{
"ICA auth module callback fails", func() {
Expand All @@ -337,12 +337,12 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() {
) error {
return fmt.Errorf("mock ica auth fails")
}
}, false,
}, fmt.Errorf("mock ica auth fails"),
},
{
"nil underlying app", func() {
isNilApp = true
}, true,
}, nil,
},
{
"middleware disabled", func() {
Expand All @@ -353,7 +353,7 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() {
) error {
return fmt.Errorf("error should be unreachable")
}
}, true,
}, nil,
},
}

Expand Down Expand Up @@ -388,10 +388,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenAck() {
cbs = controller.NewIBCMiddleware(suite.chainA.GetSimApp().ICAControllerKeeper)
}

if tc.expPass {
if tc.expErr == nil {
suite.Require().NoError(err)
} else {
suite.Require().Error(err)
suite.Require().ErrorContains(err, tc.expErr.Error())
}
})
}
Expand Down Expand Up @@ -484,15 +484,15 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {
testCases := []struct {
name string
malleate func()
expPass bool
expErr error
}{
{
"success", func() {}, true,
"success", func() {}, nil,
},
{
"nil underlying app", func() {
isNilApp = true
}, true,
}, nil,
},
}

Expand Down Expand Up @@ -524,10 +524,10 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {
err = cbs.OnChanCloseConfirm(
suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID)

if tc.expPass {
if tc.expErr == nil {
suite.Require().NoError(err)
} else {
suite.Require().Error(err)
suite.Require().ErrorIs(err, tc.expErr)
}
})
}
Expand All @@ -536,9 +536,9 @@ func (suite *InterchainAccountsTestSuite) TestOnChanCloseConfirm() {

func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {
testCases := []struct {
name string
malleate func()
expPass bool
name string
malleate func()
expSuccess bool
}{
{
"ICA OnRecvPacket fails with ErrInvalidChannelFlow", func() {}, false,
Expand Down Expand Up @@ -579,7 +579,7 @@ func (suite *InterchainAccountsTestSuite) TestOnRecvPacket() {

ctx := suite.chainA.GetContext()
ack := cbs.OnRecvPacket(ctx, path.EndpointA.GetChannel().Version, packet, nil)
suite.Require().Equal(tc.expPass, ack.Success())
suite.Require().Equal(tc.expSuccess, ack.Success())

expectedEvents := sdk.Events{
sdk.NewEvent(
Expand Down Expand Up @@ -607,17 +607,17 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {
testCases := []struct {
msg string
malleate func()
expPass bool
expErr error
}{
{
"success",
func() {},
true,
nil,
},
{
"controller submodule disabled", func() {
suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false))
}, false,
}, types.ErrControllerSubModuleDisabled,
},
{
"ICA auth module callback fails", func() {
Expand All @@ -626,12 +626,12 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {
) error {
return fmt.Errorf("mock ica auth fails")
}
}, false,
}, fmt.Errorf("mock ica auth fails"),
},
{
"nil underlying app", func() {
isNilApp = true
}, true,
}, nil,
},
{
"middleware disabled", func() {
Expand All @@ -642,7 +642,7 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {
) error {
return fmt.Errorf("error should be unreachable")
}
}, true,
}, nil,
},
}

Expand Down Expand Up @@ -685,10 +685,10 @@ func (suite *InterchainAccountsTestSuite) TestOnAcknowledgementPacket() {

err = cbs.OnAcknowledgementPacket(suite.chainA.GetContext(), path.EndpointA.GetChannel().Version, packet, []byte("ack"), nil)

if tc.expPass {
if tc.expErr == nil {
suite.Require().NoError(err)
} else {
suite.Require().Error(err)
suite.Require().ErrorContains(err, tc.expErr.Error())
}
})
}
Expand All @@ -704,17 +704,17 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {
testCases := []struct {
msg string
malleate func()
expPass bool
expErr error
}{
{
"success",
func() {},
true,
nil,
},
{
"controller submodule disabled", func() {
suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false))
}, false,
}, types.ErrControllerSubModuleDisabled,
},
{
"ICA auth module callback fails", func() {
Expand All @@ -723,12 +723,12 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {
) error {
return fmt.Errorf("mock ica auth fails")
}
}, false,
}, fmt.Errorf("mock ica auth fails"),
},
{
"nil underlying app", func() {
isNilApp = true
}, true,
}, nil,
},
{
"middleware disabled", func() {
Expand All @@ -739,7 +739,7 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {
) error {
return fmt.Errorf("error should be unreachable")
}
}, true,
}, nil,
},
}

Expand Down Expand Up @@ -782,10 +782,10 @@ func (suite *InterchainAccountsTestSuite) TestOnTimeoutPacket() {

err = cbs.OnTimeoutPacket(suite.chainA.GetContext(), path.EndpointA.GetChannel().Version, packet, nil)

if tc.expPass {
if tc.expErr == nil {
suite.Require().NoError(err)
} else {
suite.Require().Error(err)
suite.Require().ErrorContains(err, tc.expErr.Error())
}
})
}
Expand Down Expand Up @@ -1123,12 +1123,10 @@ func (suite *InterchainAccountsTestSuite) TestSingleHostMultipleControllers() {
testCases := []struct {
msg string
malleate func()
expPass bool
}{
{
"success",
func() {},
true,
},
}

Expand Down
Loading

0 comments on commit 75fbeaa

Please sign in to comment.