Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 8 additions & 14 deletions ledger/alonzo/alonzo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
22 changes: 8 additions & 14 deletions ledger/babbage/babbage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
12 changes: 2 additions & 10 deletions ledger/common/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions ledger/common/address_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down