Skip to content

Commit

Permalink
Merge branch 'main' into colin/7231-rm-wasm-callbacks-bin-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisJim authored Nov 12, 2024
2 parents 1caf16b + 083cfb1 commit 73e6fbf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: make build-docs

- name: Deploy 🚀
uses: JamesIves/[email protected].8
uses: JamesIves/[email protected].9
with:
branch: gh-pages
folder: docs/build
Expand Down
6 changes: 5 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ const config = {
// Exclude template markdown files from the docs
exclude: ["**/*.template.md"],
// Select the latest version
lastVersion: "v8.5.x",
lastVersion: "v9.0.x",
// Assign banners to specific versions
versions: {
current: {
path: "main",
banner: "unreleased",
},
"v9.0.x": {
path: "v9",
banner: "none",
},
"v8.5.x": {
path: "v8",
banner: "none",
Expand Down
34 changes: 30 additions & 4 deletions modules/core/04-channel/types/packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,44 @@ import (
)

func TestCommitPacket(t *testing.T) {
packet := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)

registry := codectypes.NewInterfaceRegistry()
clienttypes.RegisterInterfaces(registry)
types.RegisterInterfaces(registry)

cdc := codec.NewProtoCodec(registry)

packet := types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp)
commitment := types.CommitPacket(cdc, packet)
require.NotNil(t, commitment)

testCases := []struct {
name string
packet types.Packet
}{
{
name: "diff data",
packet: types.NewPacket(unknownPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, timeoutTimestamp),
},
{
name: "diff timeout revision number",
packet: types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, clienttypes.NewHeight(timeoutHeight.RevisionNumber+1, timeoutHeight.RevisionHeight), timeoutTimestamp),
},
{
name: "diff timeout revision height",
packet: types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, clienttypes.NewHeight(timeoutHeight.RevisionNumber, timeoutHeight.RevisionHeight+1), timeoutTimestamp),
},
{
name: "diff timeout timestamp",
packet: types.NewPacket(validPacketData, 1, portid, chanid, cpportid, cpchanid, timeoutHeight, uint64(1)),
},
}

for _, tc := range testCases {
testCommitment := types.CommitPacket(cdc, tc.packet)
require.NotNil(t, testCommitment)

require.NotEqual(t, commitment, testCommitment)
}
}

func TestPacketValidateBasic(t *testing.T) {
Expand All @@ -44,8 +72,6 @@ func TestPacketValidateBasic(t *testing.T) {
}

for i, tc := range testCases {
tc := tc

err := tc.packet.ValidateBasic()
if tc.expPass {
require.NoError(t, err, "Msg %d failed: %s", i, tc.errMsg)
Expand Down

0 comments on commit 73e6fbf

Please sign in to comment.