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

fix: Importing DIDs and resources from v0.6.x genesis #487

Merged
merged 43 commits into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c4bc746
Fix for importing DIDs from genesis file
Dec 20, 2022
24ca4c6
fix(installer): Backport to v0.6.x release branch (#379)
ankurdotb Aug 22, 2022
60cf85a
dragonberry
faddat Oct 16, 2022
8d7c5fb
dragonberry
faddat Oct 16, 2022
d9bcd83
build: Backport workflow and other fixes to release/0.6.x branch [DEV…
ankurdotb Oct 16, 2022
33b1ad0
Merge branch 'dragonberry-fix' into dragonberry
ankurdotb Oct 17, 2022
0c33fb6
fix: dragonberry (#409)
ankurdotb Oct 17, 2022
b1d3d06
Bump version of cosmos sdk
Oct 17, 2022
0c6fd1a
Go mod tidy
askolesov Oct 17, 2022
92b9ac6
Switch back to cheqd cosmos fork
askolesov Oct 17, 2022
f49e465
Fix build
askolesov Oct 17, 2022
3bdec19
Bump dockerfile go v1.18
Eengineer1 Oct 17, 2022
3f1234b
Added recommended patch changes
Eengineer1 Oct 17, 2022
f94f029
Update configure.go
askolesov Oct 17, 2022
57d2746
Woraround for Tendermint's defaut storage config
askolesov Oct 17, 2022
d788e5c
Fix dockerfile
askolesov Oct 17, 2022
0a6c992
Remove .dockerignore
askolesov Oct 17, 2022
f76be20
Fix cosmos deafult config
askolesov Oct 17, 2022
2f8949f
fix(security): Bump version of cosmos sdk (#413)
askolesov Oct 17, 2022
49639bf
Merge branch 'release/0.6.x' into dragonberry-fix
ankurdotb Oct 17, 2022
8a1444b
Create .dockerignore
ankurdotb Oct 17, 2022
70fd28c
Revert copy stage changes
ankurdotb Oct 17, 2022
c3cba9d
Bump golang CI linter to 1.18
ankurdotb Oct 17, 2022
52357a4
Bump CodeQL to 1.18
ankurdotb Oct 17, 2022
fd4cc8d
ci(docker): Docker build for Dragonberry patch [DEV-1824] (#411)
ankurdotb Oct 17, 2022
638dfbd
ci: Sync tag version format
ankurdotb Oct 28, 2022
9e7f7ff
Squashed commit of the following:
ankurdotb Aug 16, 2022
d40b0eb
chore(deps): Bump goreleaser/goreleaser-action from 3 to 4 (#486)
dependabot[bot] Dec 20, 2022
65a54f7
chore(deps): Bump bufbuild/buf-setup-action from 1.8.0 to 1.10.0 (#477)
dependabot[bot] Dec 13, 2022
475a823
ci: Update PR title check (#463)
ankurdotb Dec 2, 2022
73a8d89
fix: Error handling (#425)
askolesov Oct 26, 2022
c2ba088
Update go.mod
ankurdotb Dec 20, 2022
3709239
Bump package
ankurdotb Dec 20, 2022
622fce9
Fix broken link
ankurdotb Dec 20, 2022
1ca771d
Fix protobuf breaking reference
ankurdotb Dec 20, 2022
5fc3883
Deactivate protobuf workflows
ankurdotb Dec 20, 2022
771e75d
Change build runners
ankurdotb Dec 20, 2022
48ea82d
Don't wrap release
ankurdotb Dec 20, 2022
92ba678
Update Dockerfile
ankurdotb Dec 20, 2022
6223291
Merge branch 'backport' into import_export_fix
ankurdotb Dec 20, 2022
5969870
Merge branch 'release/0.6.x' into import_export_fix
ankurdotb Dec 20, 2022
2613ad1
Remove redundant set DID count
ankurdotb Dec 20, 2022
4737b0c
gofumpt
ankurdotb Dec 20, 2022
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
9 changes: 4 additions & 5 deletions x/cheqd/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ import (
// InitGenesis initializes the cheqd module's state from a provided genesis
// state.
func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) {
// Set did namespace
ctx.Logger().Info("Setting did namespace to: " + genState.DidNamespace)
k.SetDidNamespace(&ctx, genState.DidNamespace)

for _, elem := range genState.DidList {
if err := k.SetDid(&ctx, elem); err != nil {
panic(fmt.Sprintf("Cannot set did case: %s", err.Error()))
}
}

// Set nym count
k.SetDidCount(&ctx, uint64(len(genState.DidList)))

k.SetDidNamespace(&ctx, genState.DidNamespace)
}

// ExportGenesis returns the cheqd module's exported genesis.
Expand Down
12 changes: 12 additions & 0 deletions x/cheqd/types/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package types

import (
"fmt"

"github.com/cosmos/cosmos-sdk/codec/types"
)

const DefaultDidNamespace = "testnet"
Expand All @@ -14,6 +16,16 @@ func DefaultGenesis() *GenesisState {
}
}

func (gs *GenesisState) UnpackInterfaces(unpacker types.AnyUnpacker) error {
for _, elem := range gs.DidList {
err := elem.UnpackInterfaces(unpacker)
if err != nil {
return err
}
}
return nil
}

// Validate performs basic genesis state validation returning an error upon any
// failure.
func (gs GenesisState) Validate() error {
Expand Down