Skip to content

Commit c284922

Browse files
authored
fix: use raw address bytes for Shelley genesis UTxO TX ID hash (#1045)
Signed-off-by: Aurora Gaffney <[email protected]>
1 parent a6c4a3b commit c284922

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ledger/shelley/genesis.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,11 @@ func (g *ShelleyGenesis) GenesisUtxos() ([]common.Utxo, error) {
109109
if err != nil {
110110
return nil, err
111111
}
112-
addrCborBytes, err := cbor.Encode(tmpAddr)
113-
if err != nil {
114-
return nil, err
115-
}
116112
ret = append(
117113
ret,
118114
common.Utxo{
119115
Id: ShelleyTransactionInput{
120-
TxId: common.Blake2b256Hash(addrCborBytes),
116+
TxId: common.Blake2b256Hash(addrBytes),
121117
OutputIndex: 0,
122118
},
123119
Output: ShelleyTransactionOutput{

ledger/shelley/genesis_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func TestGenesisFromJson(t *testing.T) {
199199
func TestGenesisUtxos(t *testing.T) {
200200
testHexAddr := "000045183c1dcaeb0ca5cf583a68b9e31a6301bcbde487065bd35b955a98ba9d3061e1bd15749cc857e94b30583c120e3255adb93b44681bad"
201201
testAmount := uint64(120_000_000_000_000)
202-
expectedTxId := "23e41590bf49ad07dd6f28db73f9f16c804b9b5791b9dd669bfc58df8a9a1129"
202+
expectedTxId := "d7357999c3867a9d8eb7c84b25a8d4fc20699d9d802f6c51a4554bd6a928783e"
203203
expectedAddr := "addr_test1qqqy2xpurh9wkr99eavr569euvdxxqduhhjgwpjm6dde2k5ch2wnqc0ph52hf8xg2l55kvzc8sfquvj44kunk3rgrwksfahlvw"
204204
// Generate genesis config JSON
205205
tmpGenesisData := map[string]any{

0 commit comments

Comments
 (0)