Skip to content

Commit

Permalink
add changelog + fix godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
gjermundgaraba committed Dec 17, 2024
1 parent 650424b commit 4b3f289
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Testing

* [\#7430](https://github.com/cosmos/ibc-go/pull/7430) Update the block proposer in test chains for each block.
* [\#7688](https://github.com/cosmos/ibc-go/pull/7688) Added `SendMsgsWithSender` to `TestChain`.

### Dependencies

Expand Down
8 changes: 5 additions & 3 deletions testing/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ func (chain *TestChain) sendMsgs(msgs ...sdk.Msg) error {
return err
}

// SendMsgs delivers a transaction through the application using a predefined sender.
// It updates the senders sequence number and updates the TestChain's headers.
// It returns the result and error if one occurred.
func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*abci.ExecTxResult, error) {
senderAccount := SenderAccount{
SenderPrivKey: chain.SenderPrivKey,
Expand All @@ -355,9 +358,7 @@ func (chain *TestChain) SendMsgs(msgs ...sdk.Msg) (*abci.ExecTxResult, error) {
return chain.SendMsgsWithSender(senderAccount, msgs...)
}

// SendMsgs delivers a transaction through the application. It updates the senders sequence
// number and updates the TestChain's headers. It returns the result and error if one
// occurred.
// SendMsgsWithSender delivers a transaction through the application using the provided sender.
func (chain *TestChain) SendMsgsWithSender(sender SenderAccount, msgs ...sdk.Msg) (*abci.ExecTxResult, error) {
if chain.SendMsgsOverride != nil {
return chain.SendMsgsOverride(msgs...)
Expand Down Expand Up @@ -603,6 +604,7 @@ func (chain *TestChain) IBCClientHeader(header *ibctm.Header, trustedHeight clie
return header, nil
}

// GetSenderAccount returns the sender account associated with the provided private key.
func (chain *TestChain) GetSenderAccount(privKey cryptotypes.PrivKey) SenderAccount {
account := chain.GetSimApp().AccountKeeper.GetAccount(chain.GetContext(), sdk.AccAddress(privKey.PubKey().Address()))

Expand Down
3 changes: 2 additions & 1 deletion testing/endpoint_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func (endpoint *Endpoint) RegisterCounterparty() (err error) {
return err
}

// MsgSendPacket sends a packet on the associated endpoint using a predefined sender. The constructed packet is returned.
func (endpoint *Endpoint) MsgSendPacket(timeoutTimestamp uint64, payload channeltypesv2.Payload) (channeltypesv2.Packet, error) {
senderAccount := SenderAccount{
SenderPrivKey: endpoint.Chain.SenderPrivKey,
Expand All @@ -47,7 +48,7 @@ func (endpoint *Endpoint) MsgSendPacket(timeoutTimestamp uint64, payload channel
return endpoint.MsgSendPacketWithSender(timeoutTimestamp, payload, senderAccount)
}

// MsgSendPacket sends a packet on the associated endpoint. The constructed packet is returned.
// MsgSendPacketWithSender sends a packet on the associated endpoint using the provided sender. The constructed packet is returned.
func (endpoint *Endpoint) MsgSendPacketWithSender(timeoutTimestamp uint64, payload channeltypesv2.Payload, sender SenderAccount) (channeltypesv2.Packet, error) {
msgSendPacket := channeltypesv2.NewMsgSendPacket(endpoint.ChannelID, timeoutTimestamp, sender.SenderAccount.GetAddress().String(), payload)

Expand Down

0 comments on commit 4b3f289

Please sign in to comment.