use emulator service account defined in flow.json for signing default
@@ -60,8 +60,15 @@ func send(
state *flowkit.State,
) (command.Result, error) {
codeFilename := args[0]
-
- signer, err := state.Accounts().ByName(sendFlags.Signer)
+ // if sendFlags.Signer != emulator-account, this means that user has specified a signer in command flag
+ // if user has not specified signer in flag, we will use service account of default emulator as specified
+ // in flow.json
+ transactionSigner := sendFlags.Signer
+ if sendFlags.Signer == "emulator-account" {
+ fmt.Printf("signing info has default ")
+ transactionSigner = state.Config().Emulators.Default().ServiceAccount
+ }
+ signer, err := state.Accounts().ByName(transactionSigner)
if err != nil {
return nil, err
}
