Skip to content

Commit

Permalink
use jsonNumber for proper serialization of recipients
Browse files Browse the repository at this point in the history
  • Loading branch information
bchamagne committed Aug 26, 2024
1 parent 996fcc2 commit fd3083f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli/transactionsCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func extractTransactionFromInputFile(config string) (ConfiguredTransaction, Send
if err != nil {
return ConfiguredTransaction{}, data, err
}

return ConfiguredTransaction{
accessSeed: seedByte,
index: data.Index,
Expand Down Expand Up @@ -257,11 +258,13 @@ func configureTransaction(configuredTransaction ConfiguredTransaction, txType ar
if recipient.Action == "" && recipient.ArgsJson == "" {
transaction.AddRecipient(recipientBytes)
} else {
d := json.NewDecoder(strings.NewReader(recipient.ArgsJson))
d.UseNumber()
var args []interface{}
err := json.Unmarshal([]byte(recipient.ArgsJson), &args)
if err != nil {
if err := d.Decode(&args); err != nil {
return nil, err
}

transaction.AddRecipientWithNamedAction(recipientBytes, []byte(recipient.Action), args)
}
}
Expand Down

0 comments on commit fd3083f

Please sign in to comment.