-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
channel/v2: Add Keeper Tests (#7456)
* test progress * use export_test and fix send_packet * fix test build * in-progress fixing tests * remove test file * fix mockv2 acknowledgment * comment on export_test * appease linter * fix bug * fix nits and add test case * add writeAck tests * use existing endpoint test fns
- Loading branch information
1 parent
4074c58
commit a3a61ff
Showing
13 changed files
with
1,202 additions
and
1,155 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package keeper | ||
|
||
/* | ||
This file is to allow for unexported functions to be accessible to the testing package. | ||
*/ | ||
|
||
import ( | ||
"context" | ||
|
||
channeltypesv2 "github.com/cosmos/ibc-go/v9/modules/core/04-channel/v2/types" | ||
"github.com/cosmos/ibc-go/v9/modules/core/exported" | ||
) | ||
|
||
func (k *Keeper) SendPacketTest( | ||
ctx context.Context, | ||
sourceChannel string, | ||
timeoutTimestamp uint64, | ||
data []channeltypesv2.PacketData, | ||
) (uint64, string, error) { | ||
return k.sendPacket( | ||
ctx, | ||
sourceChannel, | ||
timeoutTimestamp, | ||
data, | ||
) | ||
} | ||
|
||
func (k *Keeper) RecvPacketTest( | ||
ctx context.Context, | ||
packet channeltypesv2.Packet, | ||
proof []byte, | ||
proofHeight exported.Height, | ||
) error { | ||
return k.recvPacket( | ||
ctx, | ||
packet, | ||
proof, | ||
proofHeight, | ||
) | ||
} | ||
|
||
func (k *Keeper) AcknowledgePacketTest( | ||
ctx context.Context, | ||
packet channeltypesv2.Packet, | ||
acknowledgement channeltypesv2.Acknowledgement, | ||
proof []byte, | ||
proofHeight exported.Height, | ||
) error { | ||
return k.acknowledgePacket( | ||
ctx, | ||
packet, | ||
acknowledgement, | ||
proof, | ||
proofHeight, | ||
) | ||
} | ||
|
||
func (k *Keeper) TimeoutPacketTest( | ||
ctx context.Context, | ||
packet channeltypesv2.Packet, | ||
proof []byte, | ||
proofHeight exported.Height, | ||
) error { | ||
return k.timeoutPacket( | ||
ctx, | ||
packet, | ||
proof, | ||
proofHeight, | ||
) | ||
} |
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
Oops, something went wrong.