From 124725da06267bf5f9703ce63dc36a973203896e Mon Sep 17 00:00:00 2001
From: n0izn0iz <n0izn0iz@users.noreply.github.com>
Date: Tue, 1 Oct 2024 10:46:21 +0200
Subject: [PATCH] fix: genesis transaction marshaling (#96)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* fix: genesis transaction marshalling

Signed-off-by: Norman Meier <norman@samourai.coop>

* fix: use correct marshaller in tests

Signed-off-by: Norman Meier <norman@samourai.coop>

---------

Signed-off-by: Norman Meier <norman@samourai.coop>
Co-authored-by: Miloš Živković <milos.zivkovic@tendermint.com>
---
 fetch/fetch.go      | 2 +-
 fetch/fetch_test.go | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fetch/fetch.go b/fetch/fetch.go
index 199f3da..db18a90 100644
--- a/fetch/fetch.go
+++ b/fetch/fetch.go
@@ -336,7 +336,7 @@ func getGenesisBlock(client Client) (*bft_types.Block, error) {
 
 	txs := make([]bft_types.Tx, len(genesisState.Txs))
 	for i, tx := range genesisState.Txs {
-		txs[i], err = amino.MarshalJSON(tx)
+		txs[i], err = amino.Marshal(tx)
 		if err != nil {
 			return nil, fmt.Errorf("unable to marshal genesis tx: %w", err)
 		}
diff --git a/fetch/fetch_test.go b/fetch/fetch_test.go
index 8fcbca0..d399008 100644
--- a/fetch/fetch_test.go
+++ b/fetch/fetch_test.go
@@ -1116,7 +1116,7 @@ func TestFetcher_Genesis(t *testing.T) {
 		expected := &types.TxResult{
 			Height:   0,
 			Index:    i,
-			Tx:       amino.MustMarshalJSON(txs[i]),
+			Tx:       amino.MustMarshal(txs[i]),
 			Response: abci.ResponseDeliverTx{},
 		}
 		require.Equal(t, expected, tx)
@@ -1397,7 +1397,7 @@ func serializeTxs(t *testing.T, txs []*std.Tx) types.Txs {
 	serializedTxs := make(types.Txs, 0, len(txs))
 
 	for _, tx := range txs {
-		serializedTx, err := amino.MarshalJSON(tx)
+		serializedTx, err := amino.Marshal(tx)
 		require.NoError(t, err)
 
 		serializedTxs = append(serializedTxs, serializedTx)