Skip to content

Commit

Permalink
[acl] add migration handler for inter-contract data struct changes (s…
Browse files Browse the repository at this point in the history
…ei-protocol#134)

## Describe your changes and provide context
Added back old proto definitions in `legacy.proto` to facilitate
migration.
Added a migration handler that iterates through wasm dependency
registrations, decode them with the legacy proto, and overwrite with the
new proto

## Testing performed to validate your change
unit tests
  • Loading branch information
codchen authored Jan 13, 2023
1 parent 737fb7a commit 5910c71
Show file tree
Hide file tree
Showing 11 changed files with 956 additions and 26 deletions.
23 changes: 23 additions & 0 deletions proto/cosmos/accesscontrol/legacy.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
syntax = "proto3";
package cosmos.accesscontrol.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos/accesscontrol/constants.proto";
import "cosmos/accesscontrol/accesscontrol.proto";

option go_package = "github.com/cosmos/cosmos-sdk/types/accesscontrol";

message LegacyAccessOperationWithSelector {
AccessOperation operation = 1;
AccessOperationSelectorType selector_type = 2;
string selector = 3;
}

message LegacyWasmDependencyMapping {
bool enabled = 1;
repeated LegacyAccessOperationWithSelector access_ops = 2 [
(gogoproto.nullable) = false
];
string reset_reason = 3;
string contract_address = 4;
}
1 change: 0 additions & 1 deletion snapshots/types/snapshot.pb.go

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

9 changes: 0 additions & 9 deletions testutil/testdata/unknonwnproto.pb.go

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

Loading

0 comments on commit 5910c71

Please sign in to comment.