Skip to content

Commit 3f1b1b3

Browse files
mergify[bot]gsai967julienrbrt
authored andcommitted
feat(client): add WithFromName to tx factory (backport cosmos#18852) (cosmos#18854)
Co-authored-by: gsai967 <153279976+gsai967@users.noreply.github.com> Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent be58a66 commit 3f1b1b3

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3737

3838
## [Unreleased]
3939

40+
### Improvements
41+
42+
* (client/tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory.
43+
4044
## [v0.47.7](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.7) - 2023-12-20
4145

4246
### Improvements

client/tx/factory.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ func (f Factory) Fees() sdk.Coins { return f.fees }
130130
func (f Factory) GasPrices() sdk.DecCoins { return f.gasPrices }
131131
func (f Factory) AccountRetriever() client.AccountRetriever { return f.accountRetriever }
132132
func (f Factory) TimeoutHeight() uint64 { return f.timeoutHeight }
133+
func (f Factory) FromName() string { return f.fromName }
133134

134135
// SimulateAndExecute returns the option to simulate and then execute the transaction
135136
// using the gas from the simulation results
@@ -201,6 +202,13 @@ func (f Factory) WithKeybase(keybase keyring.Keyring) Factory {
201202
return f
202203
}
203204

205+
// WithFromName returns a copy of the Factory with updated fromName
206+
// fromName will be use for building a simulation tx.
207+
func (f Factory) WithFromName(fromName string) Factory {
208+
f.fromName = fromName
209+
return f
210+
}
211+
204212
// WithSequence returns a copy of the Factory with an updated sequence number.
205213
func (f Factory) WithSequence(sequence uint64) Factory {
206214
f.sequence = sequence

0 commit comments

Comments
 (0)