Skip to content

Commit

Permalink
Fix output of flow accounts create (#1779)
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink authored Oct 3, 2024
1 parent 5e02239 commit 594a7af
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions internal/accounts/create-interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ import (
//
// This process takes the user through couple of steps with prompts asking for them to provide name and network,
// and it then uses account creation APIs to automatically create the account on the network as well as save it.
func createInteractive(state *flowkit.State) (*accountResult, error) {
func createInteractive(
state *flowkit.State,
) (*accountResult, error) {
log := output.NewStdoutLogger(output.InfoLog)
name := prompt.AccountNamePrompt(state.Accounts().Names())
networkName, selectedNetwork := prompt.CreateAccountNetworkPrompt()
Expand Down Expand Up @@ -110,12 +112,14 @@ func createInteractive(state *flowkit.State) (*accountResult, error) {
}
outputList(log, items, false)

// Get account details from the network
networkAccount, err := flow.GetAccount(context.Background(), account.Address)
if err != nil {
return nil, fmt.Errorf("failed to get details for created account %s: %w", account.Address, err)
}

return &accountResult{
Account: &flowsdk.Account{
Address: account.Address,
Balance: 0,
Keys: []*flowsdk.AccountKey{flowsdk.NewAccountKey().FromPrivateKey(key)},
},
Account: networkAccount,
include: nil,
}, nil
}
Expand Down

0 comments on commit 594a7af

Please sign in to comment.