Skip to content

Commit ea3bd57

Browse files
committed
Move GetSignerAccount to accounts utils
1 parent 1401e52 commit ea3bd57

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

internal/util/accounts.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,12 @@ func ResolveAddressOrAccountNameForNetworks(input string, state *flowkit.State,
145145
networksStr := strings.Join(supportedNetworks, " and ")
146146
return flow.EmptyAddress, fmt.Errorf("account %s has address %s which is not valid for %s addresses", input, account.Address.String(), networksStr)
147147
}
148+
149+
// GetSignerAccount resolves and returns the signer account from the state by name
150+
func GetSignerAccount(state *flowkit.State, signerName string) (*accounts.Account, error) {
151+
signer, err := state.Accounts().ByName(signerName)
152+
if err != nil {
153+
return nil, fmt.Errorf("failed to resolve signer account '%s': %w", signerName, err)
154+
}
155+
return signer, nil
156+
}

internal/util/util.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,6 @@ func ResolveAddressOrAccountName(input string, state *flowkit.State) (flow.Addre
300300
return account.Address, nil
301301
}
302302

303-
// GetSignerAccount resolves and returns the signer account from the state by name
304-
func GetSignerAccount(state *flowkit.State, signerName string) (*accounts.Account, error) {
305-
signer, err := state.Accounts().ByName(signerName)
306-
if err != nil {
307-
return nil, fmt.Errorf("failed to resolve signer account '%s': %w", signerName, err)
308-
}
309-
return signer, nil
310-
}
311-
312303
// IsEmulatorRunning checks if the emulator is running on the given host
313304
func IsEmulatorRunning(host string) bool {
314305
conn, err := net.DialTimeout("tcp", host, 2*time.Second)

0 commit comments

Comments
 (0)