Skip to content

Fix Shelley genesis parsing#577

Merged
scarmuega merged 1 commit into
txpipe:mainfrom
SebastienGllmt:shelley-genesis
Jan 15, 2025
Merged

Fix Shelley genesis parsing#577
scarmuega merged 1 commit into
txpipe:mainfrom
SebastienGllmt:shelley-genesis

Conversation

@SebastienGllmt
Copy link
Copy Markdown
Contributor

@SebastienGllmt SebastienGllmt commented Jan 14, 2025

This fixes the Shelley part of #296

Notably,

  • fix the type for pools
  • fix the type for initial_funds

Additionally, this PR adds a new shelley_utxos helper function to help unblock this Dolos issue: txpipe/dolos#427

Background

This PR introduces a new "golden" test, which is taken from the Haskell codebase here

Notably, you can find the original code for this serialization logic in the Haskell codebase at the following:

  • pool parsing here
  • initial funds UTXO parsing here

Comment on lines +236 to +253
#[test]
fn calc_address_txid() {
let config = load_test_data_config("golden");
let utxos = shelley_utxos(&config);
let utxo = utxos.first().unwrap();
assert_eq!(
utxo.0.to_string(),
"f9ec23569778d1c5f7f43e0e98464335f02fb98b57683faa1c6b18c82921d2da"
);
assert_eq!(
utxo.1.to_bech32().unwrap(),
"addr_test1qrsm4h32h9r95f8at64ykuugxqu3wvu0s5ay3vg6tlyevjh4e2flkegka00r69gt8c4vkxgf2vnnph3nsvhlkg5ukgxslee3tf"
);
assert_eq!(
utxo.2,
12157196
);
}
Copy link
Copy Markdown
Contributor Author

@SebastienGllmt SebastienGllmt Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tested this gives the same UTXO as running a yaci-devkit local node with this genesis config👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants