Skip to content

Commit

Permalink
bump maestro deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Salvionied committed Sep 1, 2024
1 parent b67a5b7 commit 25fb15e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions serialization/Value/Value.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ func (val *AlonzoValue) UnmarshalCBOR(value []byte) error {
func (alVal *AlonzoValue) MarshalCBOR() ([]byte, error) {
if alVal.HasAssets {
if alVal.Am.Coin < 0 {
fmt.Println(alVal.ToValue().GetCoin())
return nil, errors.New("invalid coin value")
}
em, _ := cbor.CanonicalEncOptions().EncMode()
return em.Marshal(alVal.Am)
} else {
if alVal.Coin < 0 {
fmt.Println(alVal.ToValue().GetCoin())
return nil, errors.New("invalid coin value")
}
return cbor.Marshal(alVal.Coin)
Expand Down Expand Up @@ -520,12 +522,14 @@ func (val *Value) UnmarshalCBOR(value []byte) error {
func (val *Value) MarshalCBOR() ([]byte, error) {
if val.HasAssets {
if val.Am.Coin < 0 {
fmt.Println(val.GetCoin())
return nil, errors.New("invalid coin value")
}
em, _ := cbor.CanonicalEncOptions().EncMode()
return em.Marshal(val.Am)
} else {
if val.Coin < 0 {
fmt.Println(val.GetCoin())
return nil, errors.New("invalid coin value")
}
return cbor.Marshal(val.Coin)
Expand Down

0 comments on commit 25fb15e

Please sign in to comment.