diff --git a/ledger/alonzo/alonzo_test.go b/ledger/alonzo/alonzo_test.go index 4fcddce7..3267aad9 100644 --- a/ledger/alonzo/alonzo_test.go +++ b/ledger/alonzo/alonzo_test.go @@ -42,13 +42,10 @@ func TestAlonzoTransactionOutputToPlutusDataCoinOnly(t *testing.T) { 0, data.NewConstr( 0, - data.NewConstr( - 0, - data.NewByteString( - []byte{ - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - }, - ), + data.NewByteString( + []byte{ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + }, ), ), data.NewConstr( @@ -109,13 +106,10 @@ func TestAlonzoTransactionOutputToPlutusDataCoinAssets(t *testing.T) { 0, data.NewConstr( 0, - data.NewConstr( - 0, - data.NewByteString( - []byte{ - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - }, - ), + data.NewByteString( + []byte{ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + }, ), ), data.NewConstr( diff --git a/ledger/babbage/babbage_test.go b/ledger/babbage/babbage_test.go index c2dcfeae..075fd7bd 100644 --- a/ledger/babbage/babbage_test.go +++ b/ledger/babbage/babbage_test.go @@ -2824,13 +2824,10 @@ func TestBabbageTransactionOutputToPlutusDataCoinOnly(t *testing.T) { 0, data.NewConstr( 0, - data.NewConstr( - 0, - data.NewByteString( - []byte{ - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - }, - ), + data.NewByteString( + []byte{ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + }, ), ), data.NewConstr( @@ -2891,13 +2888,10 @@ func TestBabbageTransactionOutputToPlutusDataCoinAssets(t *testing.T) { 0, data.NewConstr( 0, - data.NewConstr( - 0, - data.NewByteString( - []byte{ - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - }, - ), + data.NewByteString( + []byte{ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + }, ), ), data.NewConstr( diff --git a/ledger/common/address.go b/ledger/common/address.go index 7757c61d..389f806f 100644 --- a/ledger/common/address.go +++ b/ledger/common/address.go @@ -295,22 +295,14 @@ func (a *Address) ToPlutusData() data.PlutusData { var paymentPd data.PlutusData switch a.addressType { case AddressTypeKeyKey, AddressTypeKeyScript, AddressTypeKeyPointer, AddressTypeKeyNone: - tmpCred := &Credential{ - CredType: CredentialTypeAddrKeyHash, - Credential: NewBlake2b224(a.paymentAddress), - } paymentPd = data.NewConstr( 0, - tmpCred.ToPlutusData(), + data.NewByteString(a.paymentAddress), ) case AddressTypeScriptKey, AddressTypeScriptScript, AddressTypeScriptPointer, AddressTypeScriptNone: - tmpCred := &Credential{ - CredType: CredentialTypeScriptHash, - Credential: NewBlake2b224(a.paymentAddress), - } paymentPd = data.NewConstr( 1, - tmpCred.ToPlutusData(), + data.NewByteString(a.paymentAddress), ) default: return nil diff --git a/ledger/common/address_test.go b/ledger/common/address_test.go index 310368fb..42cb63e5 100644 --- a/ledger/common/address_test.go +++ b/ledger/common/address_test.go @@ -339,13 +339,10 @@ func TestAddressToPlutusData(t *testing.T) { 0, data.NewConstr( 0, - data.NewConstr( - 0, - data.NewByteString( - []byte{ - 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, - }, - ), + data.NewByteString( + []byte{ + 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, + }, ), ), data.NewConstr(