Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: capability addition to ibc-go structure #3097

Merged
merged 51 commits into from
Mar 30, 2023
Merged
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4ce6c42
proposal capability addition to ibc-go
tac0turtle Feb 1, 2023
c63f833
Merge branch 'main' into marko/capability
tac0turtle Feb 13, 2023
cc6f3e4
Merge branch 'main' into marko/capability
chatton Mar 1, 2023
d5ff31a
moved cability module up one level and fixed imports for sdk types
chatton Mar 1, 2023
dc843d7
changed module import path
chatton Mar 1, 2023
9fc47f0
adding proto files and generated pb files
chatton Mar 1, 2023
8c53c91
pinning sdk version to tip of rc2 release branch
chatton Mar 1, 2023
e78b44e
Merge branch 'main' into marko/capability
chatton Mar 10, 2023
f328da0
adding capability code from sdk v0.47-rc3
chatton Mar 10, 2023
a83d5b8
comment out tests temporarily and use local pin to capability module
chatton Mar 10, 2023
682dbfa
updating go.mods
chatton Mar 10, 2023
740d999
fix docker build
chatton Mar 10, 2023
bde7265
pin iavl in e2e
chatton Mar 10, 2023
d9774d9
pinning ledger version
chatton Mar 10, 2023
8c0b780
moderate deps - downgrade iavl and cosmos-ledger-go and remove pins
damiannolan Mar 14, 2023
ae3401b
clean up go.mods
damiannolan Mar 14, 2023
91fbf42
Merge branch 'main' into marko/capability
chatton Mar 15, 2023
4071d60
make lint-fix
chatton Mar 15, 2023
9088f5a
Merge branch 'main' into marko/capability
damiannolan Mar 15, 2023
1b37341
refactor and fix failing tests
damiannolan Mar 16, 2023
81753c0
remove pins in go.mod
damiannolan Mar 16, 2023
7d7e4a6
cleanup testhelpers
damiannolan Mar 16, 2023
64774d1
cleanup test code
damiannolan Mar 17, 2023
990ba87
adding CI for capability module
chatton Mar 21, 2023
3141175
adding CI for capability module
chatton Mar 21, 2023
e1d2d29
run workflow when workflow changes
chatton Mar 21, 2023
cc5d5fc
trigger ci
chatton Mar 21, 2023
9eafa5a
always trigger workflow
chatton Mar 21, 2023
baededa
test workflow triggering
chatton Mar 21, 2023
fe2fddf
test workflow
chatton Mar 21, 2023
e8ccbed
Merge branch 'main' into marko/capability
chatton Mar 21, 2023
e0086da
trigger workflow
chatton Mar 21, 2023
7a34eda
trigger workflow
chatton Mar 21, 2023
1b7a463
using tag of alpha1
chatton Mar 21, 2023
c5ce26c
Merge branch 'main' into marko/capability
chatton Mar 21, 2023
7955031
added verbose flag to workflow
chatton Mar 21, 2023
ed26371
remove module pin from e2e go.mod
chatton Mar 21, 2023
879dc54
undid interchain test replace
chatton Mar 21, 2023
0fedb5a
Merge branch 'main' into marko/capability
damiannolan Mar 21, 2023
a82c998
organise imports
damiannolan Mar 21, 2023
1765fa7
cleanup go.mod
damiannolan Mar 22, 2023
06709e0
removing todo in errors.go
damiannolan Mar 22, 2023
f8e1cef
use aliased import in simapp for ibcmock
damiannolan Mar 22, 2023
135f2e4
Merge branch 'main' into marko/capability
damiannolan Mar 22, 2023
2ec1dea
Merge branch 'main' into marko/capability
chatton Mar 22, 2023
586d870
addressed PR feedback
chatton Mar 23, 2023
e450442
reanmed proto from v1beta1 to v1
chatton Mar 23, 2023
8efce66
Merge branch 'main' into marko/capability
chatton Mar 23, 2023
5b7c0e9
merge main
chatton Mar 30, 2023
878ea98
Merge branch 'main' into marko/capability
chatton Mar 30, 2023
ea8dabb
update capability module go.mod and go.sum
chatton Mar 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adding proto files and generated pb files
chatton committed Mar 1, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 9fc47f01cbe4d286c47293a86812552031d0583c
8 changes: 4 additions & 4 deletions capability/capability_test.go
Original file line number Diff line number Diff line change
@@ -12,12 +12,12 @@ import (
simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
sdk "github.com/cosmos/cosmos-sdk/types"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/ibc-go/capability"
"github.com/stretchr/testify/suite"

"github.com/ibc-go/capability/keeper"
"github.com/ibc-go/capability/testutil"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability"
"github.com/cosmos/ibc-go/capability/keeper"
"github.com/cosmos/ibc-go/capability/testutil"
"github.com/cosmos/ibc-go/capability/types"
)

type CapabilityTestSuite struct {
4 changes: 2 additions & 2 deletions capability/genesis.go
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@ package capability

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ibc-go/capability/keeper"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/keeper"
"github.com/cosmos/ibc-go/capability/types"
)

// InitGenesis initializes the capability module's state from a provided genesis
6 changes: 3 additions & 3 deletions capability/genesis_test.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package capability_test

import (
"github.com/ibc-go/capability"
"github.com/cosmos/ibc-go/capability"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

storetypes "cosmossdk.io/store/types"

simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/ibc-go/capability/keeper"
"github.com/ibc-go/capability/testutil"
"github.com/cosmos/ibc-go/capability/keeper"
"github.com/cosmos/ibc-go/capability/testutil"
)

func (suite *CapabilityTestSuite) TestGenesis() {
2 changes: 1 addition & 1 deletion capability/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ibc-go/capability
module github.com/cosmos/ibc-go/capability

go 1.19

2 changes: 1 addition & 1 deletion capability/keeper/keeper.go
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import (
log "cosmossdk.io/log"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/types"
)

type (
6 changes: 3 additions & 3 deletions capability/keeper/keeper_test.go
Original file line number Diff line number Diff line change
@@ -11,9 +11,9 @@ import (
"github.com/cosmos/cosmos-sdk/testutil"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/ibc-go/capability"
"github.com/ibc-go/capability/keeper"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability"
"github.com/cosmos/ibc-go/capability/keeper"
"github.com/cosmos/ibc-go/capability/types"
)

var (
6 changes: 3 additions & 3 deletions capability/module.go
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/ibc-go/capability/keeper"
"github.com/ibc-go/capability/simulation"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/keeper"
"github.com/cosmos/ibc-go/capability/simulation"
"github.com/cosmos/ibc-go/capability/types"
)

var (
310 changes: 310 additions & 0 deletions capability/module/v1/module.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion capability/simulation/decoder.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/types"
)

// NewDecodeStore returns a decoder function closure that unmarshals the KVPair's
6 changes: 3 additions & 3 deletions capability/simulation/decoder_test.go
Original file line number Diff line number Diff line change
@@ -4,15 +4,15 @@ import (
"fmt"
"testing"

"github.com/ibc-go/capability/simulation"
"github.com/cosmos/ibc-go/capability/simulation"
"github.com/stretchr/testify/require"

"cosmossdk.io/depinject"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/kv"
"github.com/ibc-go/capability/testutil"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/testutil"
"github.com/cosmos/ibc-go/capability/types"
)

func TestDecodeStore(t *testing.T) {
2 changes: 1 addition & 1 deletion capability/simulation/genesis.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"math/rand"

"github.com/cosmos/cosmos-sdk/types/module"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/types"
)

// Simulation parameter constants
4 changes: 2 additions & 2 deletions capability/simulation/genesis_test.go
Original file line number Diff line number Diff line change
@@ -5,15 +5,15 @@ import (
"math/rand"
"testing"

"github.com/ibc-go/capability/simulation"
"github.com/cosmos/ibc-go/capability/simulation"
"github.com/stretchr/testify/require"

sdkmath "cosmossdk.io/math"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/types/module"
simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/types"
)

// TestRandomizedGenState tests the normal scenario of applying RandomizedGenState.
6 changes: 4 additions & 2 deletions capability/testutil/app_config.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,8 @@ import (
_ "github.com/cosmos/cosmos-sdk/x/genutil" // import as blank for app wiring
_ "github.com/cosmos/cosmos-sdk/x/params" // import as blank for app wiring
_ "github.com/cosmos/cosmos-sdk/x/staking" // import as blank for app wiring
_ "github.com/ibc-go/capability" // import as blank for app wiring

_ "github.com/cosmos/ibc-go/capability" // import as blank for app wiring

"cosmossdk.io/core/appconfig"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -17,7 +18,8 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
capabilitytypes "github.com/ibc-go/capability/types"

capabilitytypes "github.com/cosmos/ibc-go/capability/types"

runtimev1alpha1 "cosmossdk.io/api/cosmos/app/runtime/v1alpha1"
appv1alpha1 "cosmossdk.io/api/cosmos/app/v1alpha1"
65 changes: 32 additions & 33 deletions capability/types/capability.pb.go
60 changes: 28 additions & 32 deletions capability/types/genesis.pb.go
2 changes: 1 addition & 1 deletion capability/types/keys_test.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/ibc-go/capability/types"
"github.com/cosmos/ibc-go/capability/types"
"github.com/stretchr/testify/require"
)

3 changes: 2 additions & 1 deletion capability/types/types_test.go
Original file line number Diff line number Diff line change
@@ -6,8 +6,9 @@ import (
"strings"
"testing"

"github.com/ibc-go/capability/types"
"github.com/stretchr/testify/require"

"github.com/cosmos/ibc-go/capability/types"
)

func TestCapabilityKey(t *testing.T) {
16 changes: 16 additions & 0 deletions proto/capability/module/v1/module.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
syntax = "proto3";

package capability.module.v1;

import "cosmos/app/v1alpha1/module.proto";

// Module is the config object of the capability module.
message Module {
option (cosmos.app.v1alpha1.module) = {
go_import: "github.com/cosmos/ibc-go/capability"
};

// seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped
// keeper. For more details check x/capability/keeper.go.
bool seal_keeper = 1;
}
29 changes: 29 additions & 0 deletions proto/capability/v1beta1/capability.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
syntax = "proto3";

package capability.v1beta1;

import "gogoproto/gogo.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/ibc-go/capability/types";

// Capability defines an implementation of an object capability. The index
// provided to a Capability must be globally unique.
message Capability {
uint64 index = 1;
}

// Owner defines a single capability owner. An owner is defined by the name of
// capability and the module name.
message Owner {
option (gogoproto.goproto_getters) = false;

string module = 1;
string name = 2;
}

// CapabilityOwners defines a set of owners of a single Capability. The set of
// owners must be unique.
message CapabilityOwners {
repeated Owner owners = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
28 changes: 28 additions & 0 deletions proto/capability/v1beta1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
syntax = "proto3";

package capability.v1beta1;

import "gogoproto/gogo.proto";
import "capability/v1beta1/capability.proto";
import "amino/amino.proto";

option go_package = "github.com/cosmos/ibc-go/capability/types";

// GenesisOwners defines the capability owners with their corresponding index.
message GenesisOwners {
// index is the index of the capability owner.
uint64 index = 1;

// index_owners are the owners at the given index.
CapabilityOwners index_owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}

// GenesisState defines the capability module's genesis state.
message GenesisState {
// index is the capability global index.
uint64 index = 1;

// owners represents a map from index to owners of the capability index
// index key is string to allow amino marshalling.
repeated GenesisOwners owners = 2 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
1 change: 1 addition & 0 deletions scripts/protocgen.sh
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ cd ..

# move proto files to the right places
cp -r github.com/cosmos/ibc-go/v*/modules/* modules/
cp -r github.com/cosmos/ibc-go/capability/* capability/
rm -rf github.com

go mod tidy