Skip to content

Commit

Permalink
update desmos to v6.1.0 and juno to v5.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MonikaCat committed Sep 1, 2023
1 parent 384fbdf commit 41adad3
Show file tree
Hide file tree
Showing 16 changed files with 365 additions and 603 deletions.
200 changes: 99 additions & 101 deletions cmd/bdjuno/desmos.go
Original file line number Diff line number Diff line change
@@ -1,112 +1,110 @@
package main

import (
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
poststypes "github.com/desmos-labs/desmos/v5/x/posts/types"
profilestypes "github.com/desmos-labs/desmos/v5/x/profiles/types"
reactionstypes "github.com/desmos-labs/desmos/v5/x/reactions/types"
relationshiptypes "github.com/desmos-labs/desmos/v5/x/relationships/types"
reportstypes "github.com/desmos-labs/desmos/v5/x/reports/types"
subspacestypes "github.com/desmos-labs/desmos/v5/x/subspaces/types"
// import (
// "github.com/cosmos/cosmos-sdk/codec"
// sdk "github.com/cosmos/cosmos-sdk/types"
// poststypes "github.com/desmos-labs/desmos/v6/x/posts/types"
// profilestypes "github.com/desmos-labs/desmos/v6/x/profiles/types"
// reactionstypes "github.com/desmos-labs/desmos/v6/x/reactions/types"
// relationshiptypes "github.com/desmos-labs/desmos/v6/x/relationships/types"
// reportstypes "github.com/desmos-labs/desmos/v6/x/reports/types"
// subspacestypes "github.com/desmos-labs/desmos/v6/x/subspaces/types"
// )

junomessages "github.com/forbole/juno/v5/modules/messages"
)
// // desmosMessageAddressesParser represents a parser able to get the addresses of the involved
// // account from a Desmos message
// var desmosMessageAddressesParser = junomessages.JoinMessageParsers(
// profilesMessageAddressesParser,
// )

// desmosMessageAddressesParser represents a parser able to get the addresses of the involved
// account from a Desmos message
var desmosMessageAddressesParser = junomessages.JoinMessageParsers(
profilesMessageAddressesParser,
)
// // profilesMessageAddressesParser represents a MessageAddressesParser for the x/profiles module
// func profilesMessageAddressesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error) {
// switch msg := cosmosMsg.(type) {

// profilesMessageAddressesParser represents a MessageAddressesParser for the x/profiles module
func profilesMessageAddressesParser(_ codec.Codec, cosmosMsg sdk.Msg) ([]string, error) {
switch msg := cosmosMsg.(type) {
// case *poststypes.MsgCreatePost:
// return []string{msg.Author}, nil
// case *poststypes.MsgEditPost:
// return []string{msg.Editor}, nil
// case *poststypes.MsgDeletePost:
// return []string{msg.Signer}, nil
// case *poststypes.MsgAddPostAttachment:
// return []string{msg.Editor}, nil
// case *poststypes.MsgRemovePostAttachment:
// return []string{msg.Editor}, nil
// case *poststypes.MsgAnswerPoll:
// return []string{msg.Signer}, nil

case *poststypes.MsgCreatePost:
return []string{msg.Author}, nil
case *poststypes.MsgEditPost:
return []string{msg.Editor}, nil
case *poststypes.MsgDeletePost:
return []string{msg.Signer}, nil
case *poststypes.MsgAddPostAttachment:
return []string{msg.Editor}, nil
case *poststypes.MsgRemovePostAttachment:
return []string{msg.Editor}, nil
case *poststypes.MsgAnswerPoll:
return []string{msg.Signer}, nil
// case *profilestypes.MsgRequestDTagTransfer:
// return []string{msg.Sender, msg.Receiver}, nil
// case *profilestypes.MsgCancelDTagTransferRequest:
// return []string{msg.Sender, msg.Receiver}, nil
// case *profilestypes.MsgAcceptDTagTransferRequest:
// return []string{msg.Sender, msg.Receiver}, nil
// case *profilestypes.MsgRefuseDTagTransferRequest:
// return []string{msg.Sender, msg.Receiver}, nil

case *profilestypes.MsgRequestDTagTransfer:
return []string{msg.Sender, msg.Receiver}, nil
case *profilestypes.MsgCancelDTagTransferRequest:
return []string{msg.Sender, msg.Receiver}, nil
case *profilestypes.MsgAcceptDTagTransferRequest:
return []string{msg.Sender, msg.Receiver}, nil
case *profilestypes.MsgRefuseDTagTransferRequest:
return []string{msg.Sender, msg.Receiver}, nil
// case *reactionstypes.MsgAddReaction:
// return []string{msg.User}, nil
// case *reactionstypes.MsgRemoveReaction:
// return []string{msg.User}, nil
// case *reactionstypes.MsgAddRegisteredReaction:
// return []string{msg.User}, nil
// case *reactionstypes.MsgEditRegisteredReaction:
// return []string{msg.User}, nil
// case *reactionstypes.MsgRemoveRegisteredReaction:
// return []string{msg.User}, nil
// case *reactionstypes.MsgSetReactionsParams:
// return []string{msg.User}, nil

case *reactionstypes.MsgAddReaction:
return []string{msg.User}, nil
case *reactionstypes.MsgRemoveReaction:
return []string{msg.User}, nil
case *reactionstypes.MsgAddRegisteredReaction:
return []string{msg.User}, nil
case *reactionstypes.MsgEditRegisteredReaction:
return []string{msg.User}, nil
case *reactionstypes.MsgRemoveRegisteredReaction:
return []string{msg.User}, nil
case *reactionstypes.MsgSetReactionsParams:
return []string{msg.User}, nil
// case *relationshiptypes.MsgCreateRelationship:
// return []string{msg.Signer, msg.Counterparty}, nil
// case *relationshiptypes.MsgDeleteRelationship:
// return []string{msg.Signer, msg.Counterparty}, nil
// case *relationshiptypes.MsgBlockUser:
// return []string{msg.Blocker, msg.Blocked}, nil
// case *relationshiptypes.MsgUnblockUser:
// return []string{msg.Blocker, msg.Blocked}, nil

case *relationshiptypes.MsgCreateRelationship:
return []string{msg.Signer, msg.Counterparty}, nil
case *relationshiptypes.MsgDeleteRelationship:
return []string{msg.Signer, msg.Counterparty}, nil
case *relationshiptypes.MsgBlockUser:
return []string{msg.Blocker, msg.Blocked}, nil
case *relationshiptypes.MsgUnblockUser:
return []string{msg.Blocker, msg.Blocked}, nil
// case *reportstypes.MsgCreateReport:
// return []string{msg.Reporter}, nil
// case *reportstypes.MsgDeleteReport:
// return []string{msg.Signer}, nil
// case *reportstypes.MsgSupportStandardReason:
// return []string{msg.Signer}, nil
// case *reportstypes.MsgAddReason:
// return []string{msg.Signer}, nil
// case *reportstypes.MsgRemoveReason:
// return []string{msg.Signer}, nil

case *reportstypes.MsgCreateReport:
return []string{msg.Reporter}, nil
case *reportstypes.MsgDeleteReport:
return []string{msg.Signer}, nil
case *reportstypes.MsgSupportStandardReason:
return []string{msg.Signer}, nil
case *reportstypes.MsgAddReason:
return []string{msg.Signer}, nil
case *reportstypes.MsgRemoveReason:
return []string{msg.Signer}, nil
// case *subspacestypes.MsgCreateSubspace:
// return []string{msg.Creator}, nil
// case *subspacestypes.MsgEditSubspace:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgDeleteSubspace:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgCreateSection:
// return []string{msg.Creator}, nil
// case *subspacestypes.MsgEditSection:
// return []string{msg.Editor}, nil
// case *subspacestypes.MsgMoveSection:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgDeleteSection:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgCreateUserGroup:
// return append([]string{msg.Creator}, msg.InitialMembers...), nil
// case *subspacestypes.MsgEditUserGroup:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgMoveUserGroup:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgDeleteUserGroup:
// return []string{msg.Signer}, nil
// case *subspacestypes.MsgAddUserToUserGroup:
// return []string{msg.Signer, msg.User}, nil
// case *subspacestypes.MsgRemoveUserFromUserGroup:
// return []string{msg.Signer, msg.User}, nil
// case *subspacestypes.MsgSetUserPermissions:
// return []string{msg.Signer, msg.User}, nil
// }

case *subspacestypes.MsgCreateSubspace:
return []string{msg.Creator}, nil
case *subspacestypes.MsgEditSubspace:
return []string{msg.Signer}, nil
case *subspacestypes.MsgDeleteSubspace:
return []string{msg.Signer}, nil
case *subspacestypes.MsgCreateSection:
return []string{msg.Creator}, nil
case *subspacestypes.MsgEditSection:
return []string{msg.Editor}, nil
case *subspacestypes.MsgMoveSection:
return []string{msg.Signer}, nil
case *subspacestypes.MsgDeleteSection:
return []string{msg.Signer}, nil
case *subspacestypes.MsgCreateUserGroup:
return append([]string{msg.Creator}, msg.InitialMembers...), nil
case *subspacestypes.MsgEditUserGroup:
return []string{msg.Signer}, nil
case *subspacestypes.MsgMoveUserGroup:
return []string{msg.Signer}, nil
case *subspacestypes.MsgDeleteUserGroup:
return []string{msg.Signer}, nil
case *subspacestypes.MsgAddUserToUserGroup:
return []string{msg.Signer, msg.User}, nil
case *subspacestypes.MsgRemoveUserFromUserGroup:
return []string{msg.Signer, msg.User}, nil
case *subspacestypes.MsgSetUserPermissions:
return []string{msg.Signer, msg.User}, nil
}

return nil, junomessages.MessageNotSupported(cosmosMsg)
}
// return nil, junomessages.MessageNotSupported(cosmosMsg)
// }
7 changes: 2 additions & 5 deletions cmd/bdjuno/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"github.com/cosmos/cosmos-sdk/types/module"
desmosapp "github.com/desmos-labs/desmos/v5/app"
desmosapp "github.com/desmos-labs/desmos/v6/app"
"github.com/forbole/juno/v5/cmd"
initcmd "github.com/forbole/juno/v5/cmd/init"
migratecmd "github.com/forbole/juno/v5/cmd/migrate"
Expand Down Expand Up @@ -62,8 +62,5 @@ func getBasicManagers() []module.BasicManager {
// a specific message.
// This should be edited by custom implementations if needed.
func getAddressesParser() messages.MessageAddressesParser {
return messages.JoinMessageParsers(
desmosMessageAddressesParser,
messages.CosmosMessageAddressesParser,
)
return messages.CosmosMessageAddressesParser
}
2 changes: 1 addition & 1 deletion database/profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"

sdk "github.com/cosmos/cosmos-sdk/types"
profilestypes "github.com/desmos-labs/desmos/v5/x/profiles/types"
profilestypes "github.com/desmos-labs/desmos/v6/x/profiles/types"

dbtypes "github.com/forbole/bdjuno/v4/database/types"
"github.com/forbole/bdjuno/v4/types"
Expand Down
Loading

0 comments on commit 41adad3

Please sign in to comment.