Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
catShaark committed Sep 13, 2024
1 parent 20375cf commit cdb3016
Show file tree
Hide file tree
Showing 9 changed files with 549 additions and 4 deletions.
17 changes: 17 additions & 0 deletions proto/realionetwork/asset/priviledges/mint/messages.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
syntax = "proto3";
package realionetwork.asset.v1;

option go_package = "github.com/realiotech/realio-network/x/asset/priviledges/mint";

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "google/protobuf/any.proto";
import "realionetwork/asset/v1/token.proto";


message MsgMintToken {
string account = 1 [ (cosmos_proto.scalar) = "cosmos.AddressString" ];
string token_id = 2;
string to_account = 3;
uint64 amount = 4;
}
2 changes: 1 addition & 1 deletion x/asset/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (m MockPrivilegeI) RegisterInterfaces(registry cdctypes.InterfaceRegistry)
}

func (m MockPrivilegeI) MsgHandler() types.MsgHandler {
return func(context context.Context, privMsg sdk.Msg) (proto.Message, error) {
return func(context context.Context, privMsg sdk.Msg, tokenID string, privAcc sdk.AccAddress) (proto.Message, error) {
typeUrl := sdk.MsgTypeURL(privMsg)
if typeUrl != sdk.MsgTypeURL(&types.MsgMock{}) {
return nil, errors.New("unsupport msg type")
Expand Down
2 changes: 1 addition & 1 deletion x/asset/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func (k msgServer) ExecutePrivilege(goCtx context.Context, msg *types.MsgExecute
}

msgHandler := privImplementation.MsgHandler()
_, err = msgHandler(ctx, sdkMsg)
_, err = msgHandler(ctx, sdkMsg, msg.TokenId, userAcc)
if err != nil {
return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "fail to execute privilege message")
}
Expand Down
1 change: 1 addition & 0 deletions x/asset/priviledges/freeze/msg_server.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package freeze
Loading

0 comments on commit cdb3016

Please sign in to comment.