Skip to content

Commit

Permalink
Add support for bigInt in plutusData json
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvionied committed Jul 3, 2024
1 parent fd4161e commit 9dfa975
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions serialization/PlutusData/PlutusData.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 9dfa975

Please sign in to comment.