forked from cosmos/relayer
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cli command to claim fees (#209)
- Loading branch information
Showing
10 changed files
with
291 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package icon | ||
|
||
import ( | ||
"github.com/cosmos/relayer/v2/relayer/chains/icon/types" | ||
"github.com/cosmos/relayer/v2/relayer/provider" | ||
) | ||
|
||
type MsgClaimFees struct { | ||
Nid string `json:"nid"` | ||
Address types.HexBytes `json:"address"` | ||
} | ||
|
||
func (icp *IconProvider) MsgClaimFees(dstChainID, dstAddress string) (provider.RelayerMessage, error) { | ||
|
||
params := MsgClaimFees{ | ||
Nid: dstChainID, | ||
Address: types.NewHexBytes([]byte(dstAddress)), | ||
} | ||
|
||
msg := icp.NewIconMessage(params, MethodClaimFees) | ||
|
||
return msg, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,4 +42,6 @@ const ( | |
MethodTimeoutPacket = "timeoutPacket" | ||
|
||
MethodGetAllPorts = "getAllPorts" | ||
|
||
MethodClaimFees = "claimFees" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package wasm | ||
|
||
import ( | ||
"encoding/json" | ||
|
||
"github.com/cosmos/relayer/v2/relayer/provider" | ||
) | ||
|
||
type ClaimFeesMsg struct { | ||
ClaimFees struct { | ||
Nid string `json:"nid"` | ||
Address string `json:"address"` | ||
} `json:"claim_fees"` | ||
} | ||
|
||
func (c *ClaimFeesMsg) Type() string { | ||
return "claim_fees" | ||
} | ||
|
||
func (c *ClaimFeesMsg) MsgBytes() ([]byte, error) { | ||
return json.Marshal(c) | ||
} | ||
|
||
func (ap *WasmProvider) MsgClaimFees(dstChainID, dstAddress string) (provider.RelayerMessage, error) { | ||
params := &ClaimFeesMsg{ | ||
ClaimFees: struct { | ||
Nid string "json:\"nid\"" | ||
Address string "json:\"address\"" | ||
}{ | ||
Nid: dstChainID, | ||
Address: dstAddress, | ||
}, | ||
} | ||
return params, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters