Skip to content

fix: minor documentation and comment improvements in simibc utilities #2599

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion testutil/simibc/chain_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
// FinalizeBlock calls app.FinalizeBlock and app.Commit.
// It sets the next block time to currentBlockTime + dt.
// This function returns the TMHeader of the block that was just ended,
//
// along with all packets emitted during FinalizeBlock.
// NOTE: this method may be used independently of the rest of simibc.
func FinalizeBlock(c *ibctesting.TestChain, dt time.Duration) (*ibctmtypes.Header, []channeltypes.Packet) {
res, err := c.App.FinalizeBlock(&abci.RequestFinalizeBlock{
Expand Down
2 changes: 1 addition & 1 deletion testutil/simibc/doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
simibc is a collection of utilities wrapping the ibc-go testing framework which make is easier to write test scenarios involving precise orders of packet and ack delivery and calls to BeginBlock and EndBlock.
simibc is a collection of utilities wrapping the ibc-go testing framework which make it easier to write test scenarios involving precise orders of packet and ack delivery and calls to BeginBlock and EndBlock.
*/
package simibc
4 changes: 2 additions & 2 deletions testutil/simibc/ordered_outbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Ack struct {
type Packet struct {
Packet channeltypes.Packet
// The number of App.Commits that have occurred since this packet was sent
// For example, if the ack was sent at height h, and the blockchain
// For example, if the packet was sent at height h, and the blockchain
// has headers ..., h, h+1, h+2 then Commits = 3
Commits int
}
Expand Down Expand Up @@ -86,7 +86,7 @@ func (n OrderedOutbox) ConsumePackets(sender string, num int) []Packet {
return ret
}

// ConsumerAcks returns the first num packets with 2 or more commits. Returned
// ConsumeAcks returns the first num packets with 2 or more commits. Returned
// acks are removed from the outbox and will not be returned again (consumed).
func (n OrderedOutbox) ConsumeAcks(sender string, num int) []Ack {
ret := []Ack{}
Expand Down
2 changes: 1 addition & 1 deletion testutil/simibc/relayed_path.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (f *RelayedPath) PacketSentByB(packet channeltypes.Packet) bool {
// AddPacket adds a packet to the outbox of the chain with chainID.
// It will fail if the chain is not involved in the relayed path,
// or if the packet does not belong to this path,
// i.e. if the pace
// i.e. if the packet does not belong to this path.
func (f *RelayedPath) AddPacket(chainID string, packet channeltypes.Packet) {
if !f.InvolvesChain(chainID) {
f.t.Fatal("in relayed path could not add packet to chain: ", chainID, " because it is not involved in the relayed path")
Expand Down