Skip to content

Commit

Permalink
Merge pull request #182 from decentrio/trinity/bridge-patch
Browse files Browse the repository at this point in the history
fix: allow MsgBridgeIn transfer coin directly to reciever
  • Loading branch information
catShaark authored Nov 29, 2024
2 parents 5e4bbf1 + 9167c8e commit 8617c2a
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 45 deletions.
1 change: 1 addition & 0 deletions proto/realionetwork/bridge/v1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ message MsgBridgeIn {
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin"
];
string reciever = 3;
}

message MsgBridgeInResponse {}
Expand Down
2 changes: 1 addition & 1 deletion x/bridge/keeper/msg_server_bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (ms msgServer) BridgeIn(goCtx context.Context, msg *types.MsgBridgeIn) (*ty
}

addrCodec := ms.authKeeper.AddressCodec()
accAddr, err := addrCodec.StringToBytes(msg.Authority)
accAddr, err := addrCodec.StringToBytes(msg.Reciever)
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions x/bridge/keeper/msg_server_bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func (suite *KeeperTestSuite) TestBridgeIn() {

if tc.setAuthority {
tc.msg.Authority = suite.admin
tc.msg.Reciever = suite.admin
}

addr, err := suite.app.AccountKeeper.AddressCodec().StringToBytes(tc.msg.Authority)
Expand Down
141 changes: 97 additions & 44 deletions x/bridge/types/tx.pb.go

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

0 comments on commit 8617c2a

Please sign in to comment.