From fd3083ffabd0ad84c7e220c79dc07372e686d4f1 Mon Sep 17 00:00:00 2001 From: bchamagne Date: Tue, 13 Aug 2024 18:26:47 +0200 Subject: [PATCH] use jsonNumber for proper serialization of recipients --- cli/transactionsCmd.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cli/transactionsCmd.go b/cli/transactionsCmd.go index ec06a15..f9a1003 100644 --- a/cli/transactionsCmd.go +++ b/cli/transactionsCmd.go @@ -30,6 +30,7 @@ func extractTransactionFromInputFile(config string) (ConfiguredTransaction, Send if err != nil { return ConfiguredTransaction{}, data, err } + return ConfiguredTransaction{ accessSeed: seedByte, index: data.Index, @@ -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) } }