From 9dfa97551f714a9b8201d01b9d73f3d0f9e477c0 Mon Sep 17 00:00:00 2001 From: Salvionied Date: Wed, 3 Jul 2024 08:31:22 +0200 Subject: [PATCH] Add support for bigInt in plutusData json --- serialization/PlutusData/PlutusData.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/serialization/PlutusData/PlutusData.go b/serialization/PlutusData/PlutusData.go index a01e60a..ce82895 100644 --- a/serialization/PlutusData/PlutusData.go +++ b/serialization/PlutusData/PlutusData.go @@ -993,6 +993,16 @@ func (pd *PlutusData) UnmarshalJSON(value []byte) error { pd.PlutusDataType = PlutusMap pd.Value = y pd.TagNr = uint64(tag) + } else if _, ok := val["biguint"]; ok { + vl := big.NewInt(0) + vl.SetBytes([]byte(val["biguint"].(string))) + pd.PlutusDataType = PlutusInt + pd.Value = vl.Uint64() + } else if _, ok := val["bignint"]; ok { + vl := big.NewInt(0) + vl.SetBytes([]byte(val["bignint"].(string))) + pd.PlutusDataType = PlutusInt + pd.Value = vl.Uint64() } else if _, ok := val["bytes"]; ok { pd.PlutusDataType = PlutusBytes pd.Value, _ = hex.DecodeString(val["bytes"].(string))