From 7aa6065cb8e7a9f14f7756653bff4d632f49244a Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Tue, 10 Oct 2023 11:40:56 -0400 Subject: [PATCH] nit --- vms/avm/service.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/vms/avm/service.go b/vms/avm/service.go index 92d3547ea5ea..6d1948ffda57 100644 --- a/vms/avm/service.go +++ b/vms/avm/service.go @@ -328,21 +328,18 @@ func (s *Service) GetTx(_ *http.Request, args *api.GetTxArgs, reply *api.GetTxRe var result any if args.Encoding == formatting.JSON { - err := tx.Unsigned.Visit(&txInit{ + err = tx.Unsigned.Visit(&txInit{ tx: tx, ctx: s.vm.ctx, typeToFxIndex: s.vm.typeToFxIndex, fxs: s.vm.fxs, }) - if err != nil { - return err - } result = tx } else { result, err = formatting.Encode(args.Encoding, tx.Bytes()) - if err != nil { - return fmt.Errorf("couldn't encode tx as string: %w", err) - } + } + if err != nil { + return err } reply.Tx, err = stdjson.Marshal(result)