Show more user-friendly error message if proposer key is missing
@@ -100,6 +100,10 @@ func (t *Transactions) Build(
return nil, err
}
+ if len(proposerAccount.Keys) <= proposerKeyIndex {
+ return nil, fmt.Errorf("failed to retrieve proposer key at index %d", proposerKeyIndex)
+ }
+
tx := flowkit.NewTransaction().
SetPayer(payer).
SetProposer(proposerAccount, proposerKeyIndex).
