Skip to content

Commit 932faba

Browse files
committed
Switch to new function
1 parent d886d0e commit 932faba

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

internal/schedule/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func listRun(
7272
accountInput := args[0]
7373

7474
// Resolve account address from input (could be address or account name)
75-
address, err := util.ResolveAddressOrAccountName(accountInput, state)
75+
address, err := util.ResolveAddressOrAccountNameForNetworks(accountInput, state, []string{"mainnet", "testnet", "emulator"})
7676
if err != nil {
7777
return nil, fmt.Errorf("failed to resolve account: %w", err)
7878
}

internal/util/util.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -283,22 +283,6 @@ func IsCoreContract(contractName string) bool {
283283
return false
284284
}
285285

286-
// ResolveAddressOrAccountName resolves a string that could be either an address or account name
287-
func ResolveAddressOrAccountName(input string, state *flowkit.State) (flow.Address, error) {
288-
address := flow.HexToAddress(input)
289-
290-
if address.IsValid(flow.Mainnet) || address.IsValid(flow.Testnet) || address.IsValid(flow.Emulator) {
291-
return address, nil
292-
}
293-
294-
account, err := state.Accounts().ByName(input)
295-
if err != nil {
296-
return flow.EmptyAddress, fmt.Errorf("could not find account with name %s", input)
297-
}
298-
299-
return account.Address, nil
300-
}
301-
302286
// IsEmulatorRunning checks if the emulator is running on the given host
303287
func IsEmulatorRunning(host string) bool {
304288
conn, err := net.DialTimeout("tcp", host, 2*time.Second)

0 commit comments

Comments
 (0)