From 49876ff2489ed1535089e7d26f8782427a1f2d0c Mon Sep 17 00:00:00 2001 From: Callum Waters Date: Wed, 19 Jun 2024 15:32:35 +0200 Subject: [PATCH] fix: usage of default address and account in tx client --- pkg/user/tx_client.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/user/tx_client.go b/pkg/user/tx_client.go index e7d47d4823..e5599664bd 100644 --- a/pkg/user/tx_client.go +++ b/pkg/user/tx_client.go @@ -50,15 +50,22 @@ func WithDefaultAddress(address sdktypes.AccAddress) Option { panic(err) } c.defaultAccount = record.Name + c.defaultAddress = address } } func WithDefaultAccount(name string) Option { return func(c *TxClient) { - if _, err := c.signer.keys.Key(name); err != nil { + rec, err := c.signer.keys.Key(name) + if err != nil { + panic(err) + } + addr, err := rec.GetAddress() + if err != nil { panic(err) } c.defaultAccount = name + c.defaultAddress = addr } }