Skip to content

Commit

Permalink
use v0.4.2 stargate API of cw-ica-controller for filetree msg
Browse files Browse the repository at this point in the history
  • Loading branch information
BiPhan4 committed Jan 31, 2024
1 parent 526aae6 commit d1f3ba2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 45 deletions.
38 changes: 7 additions & 31 deletions e2e/interchaintest/filetree_post_key_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ import (
"fmt"
"time"

sdkmath "cosmossdk.io/math"
"github.com/cosmos/gogoproto/proto"
icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"

logger "github.com/JackalLabs/storage-outpost/e2e/interchaintest/logger"

filetreetypes "github.com/JackalLabs/storage-outpost/e2e/interchaintest/filetreetypes"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
testtypes "github.com/JackalLabs/storage-outpost/e2e/interchaintest/types"
sdk "github.com/cosmos/cosmos-sdk/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
)

// WARNING: strangelove's test package builds chains running ibc-go/v7
Expand Down Expand Up @@ -57,34 +56,11 @@ func (s *ContractTestSuite) TestIcaContractExecutionTestWithFiletree() {

fmt.Println("filetree msg as string is", filetreeMsg.String())

testProposal := govtypes.TextProposal{ // WARNING: This is from cosmos-sdk v0.47. If canined rejects it, could be a versioning/protobuf type issue
Title: "IBC Gov Proposal",
Description: "Hey it's Bi sending tokens from the outpost",
}
protoAny, err := codectypes.NewAnyWithValue(&testProposal)
s.Require().NoError(err)

proposalMsg := &govtypes.MsgSubmitProposal{
Content: protoAny,
InitialDeposit: sdk.NewCoins(sdk.NewCoin(canined.Config().Denom, sdkmath.NewInt(5_000))),
Proposer: s.IcaAddress,
}

propMsg := proposalMsg
propTypeURL := sdk.MsgTypeURL(propMsg)

fmt.Println("prop type URL is?:", propTypeURL)
logger.LogInfo(propTypeURL)

// type URL of filetree msg doesn't print whereas type URL of proposal msg does print
// is it possible that passing filetree msg by reference was not working?

// Execute the contract:
// error := s.Contract.ExecSendStargateMsgs(ctx, wasmdUser.KeyName(), []proto.Message{filetreeMsg}, nil, nil)
// s.Require().NoError(error)

// We haven't implemented call backs so at this point we could just start a shell session in the container to
// view the filetree entry
sendStargateMsg := testtypes.NewExecuteMsg_SendCosmosMsgs_FromProto(
[]proto.Message{filetreeMsg}, nil, nil,
)
error := s.Contract.Execute(ctx, wasmdUser.KeyName(), sendStargateMsg)
s.Require().NoError(error)

},
)
Expand Down
28 changes: 14 additions & 14 deletions e2e/interchaintest/logs/test.log
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
INFO: 2024/01/31 13:25:44 Wasmd First light client is
INFO: 2024/01/31 13:25:44 [
INFO: 2024/01/31 13:40:20 Wasmd First light client is
INFO: 2024/01/31 13:40:20 [
{
"client_id": "07-tendermint-0",
"client_state": {
Expand All @@ -13,20 +13,20 @@ INFO: 2024/01/31 13:25:44 [
}
}
]
INFO: 2024/01/31 13:25:44 Wasmd Second light client is
INFO: 2024/01/31 13:25:44 null
INFO: 2024/01/31 13:25:45 jackal first light client is
INFO: 2024/01/31 13:25:45 [
INFO: 2024/01/31 13:40:20 Wasmd Second light client is
INFO: 2024/01/31 13:40:20 null
INFO: 2024/01/31 13:40:21 jackal first light client is
INFO: 2024/01/31 13:40:21 [
{
"client_id": "07-tendermint-0",
"client_state": {
"chain_id": "wasmd-1"
}
}
]
INFO: 2024/01/31 13:25:45 jackal second light client is
INFO: 2024/01/31 13:25:45 null
INFO: 2024/01/31 13:26:12 {
INFO: 2024/01/31 13:40:21 jackal second light client is
INFO: 2024/01/31 13:40:21 null
INFO: 2024/01/31 13:40:49 {
"id": "connection-0",
"client_id": "07-tendermint-0",
"versions": [
Expand All @@ -48,7 +48,7 @@ INFO: 2024/01/31 13:26:12 {
},
"delay_period": "0"
}
INFO: 2024/01/31 13:26:12 {
INFO: 2024/01/31 13:40:49 {
"id": "connection-localhost",
"client_id": "09-localhost",
"versions": [
Expand All @@ -70,8 +70,8 @@ INFO: 2024/01/31 13:26:12 {
},
"delay_period": "0"
}
INFO: 2024/01/31 13:26:13 The first canined connections are:
INFO: 2024/01/31 13:26:13 {
INFO: 2024/01/31 13:40:49 The first canined connections are:
INFO: 2024/01/31 13:40:49 {
"id": "connection-0",
"client_id": "07-tendermint-0",
"versions": [
Expand All @@ -93,5 +93,5 @@ INFO: 2024/01/31 13:26:13 {
},
"delay_period": "0"
}
INFO: 2024/01/31 13:27:26 initial balance is: 1000000000
INFO: 2024/01/31 13:27:26 Executing custom ICA message now
INFO: 2024/01/31 13:42:03 initial balance is: 1000000000
INFO: 2024/01/31 13:42:03 Executing custom ICA message now
1 change: 1 addition & 0 deletions e2e/interchaintest/send_with_protobuf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (s *ContractTestSuite) TestIcaContractExecutionTestWithProtobuf() {
fmt.Println("Executing custom ICA message now")

// NOTE: Stargate API does not seem to be working for proposalMsg and depositMsg
// Not even the v0.4.2 version is working

sendStargateMsg := testtypes.NewExecuteMsg_SendCosmosMsgs_FromProto(
[]proto.Message{proposalMsg, depositMsg}, nil, nil,
Expand Down

0 comments on commit d1f3ba2

Please sign in to comment.