feat(miniprotocols): Implement tx submission client (#220)
* feat(miniprotocols): Implement tx submission client * Match CDDL specs * Fix build errors * Add server implementation for txsubmission Also includes some documentation for how to use both the client and the server * cargo fmt * clippy suggestions clippy pls * Fail explicitly on missing n2c unix socket --------- Co-authored-by: Pi Lanningham <pi@sundaeswap.finance>
This commit is contained in:
parent
e5d8950e9f
commit
6a3679dcda
19 changed files with 785 additions and 355 deletions
|
|
@ -47,7 +47,7 @@ mod tests {
|
|||
let block_idx = 1;
|
||||
let block_str = include_str!("../../test_data/byron4.block");
|
||||
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {}", block_idx));
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {block_idx}"));
|
||||
let block = crate::MultiEraBlock::decode_byron(&block_bytes).unwrap();
|
||||
let txs = block.txs();
|
||||
|
||||
|
|
|
|||
|
|
@ -162,9 +162,9 @@ mod tests {
|
|||
let block_idx = 1;
|
||||
let block_str = include_str!("../../test_data/byron1.block");
|
||||
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {}", block_idx));
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {block_idx}"));
|
||||
let (_, block_model): BlockWrapper = minicbor::decode(&block_bytes[..])
|
||||
.expect(&format!("error decoding cbor for file {}", block_idx));
|
||||
.expect(&format!("error decoding cbor for file {block_idx}"));
|
||||
|
||||
let computed_hash = block_model.header.original_hash();
|
||||
|
||||
|
|
@ -182,9 +182,9 @@ mod tests {
|
|||
let block_idx = 1;
|
||||
let block_str = include_str!("../../test_data/alonzo1.block");
|
||||
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {}", block_idx));
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {block_idx}"));
|
||||
let (_, block_model): BlockWrapper = minicbor::decode(&block_bytes[..])
|
||||
.expect(&format!("error decoding cbor for file {}", block_idx));
|
||||
.expect(&format!("error decoding cbor for file {block_idx}"));
|
||||
|
||||
let valid_hashes = vec![
|
||||
"8ae0cd531635579a9b52b954a840782d12235251fb1451e5c699e864c677514a",
|
||||
|
|
@ -209,9 +209,9 @@ mod tests {
|
|||
let block_idx = 1;
|
||||
let block_str = include_str!("../../test_data/babbage1.block");
|
||||
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {}", block_idx));
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {block_idx}"));
|
||||
let (_, block_model): BlockWrapper = minicbor::decode(&block_bytes[..])
|
||||
.expect(&format!("error decoding cbor for file {}", block_idx));
|
||||
.expect(&format!("error decoding cbor for file {block_idx}"));
|
||||
|
||||
let valid_hashes = vec!["3fad302595665b004971a6b76909854a39a0a7ecdbff3692f37b77ae37dbe882"];
|
||||
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ mod tests {
|
|||
let block_idx = 1;
|
||||
let block_str = include_str!("../../test_data/byron1.block");
|
||||
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {}", block_idx));
|
||||
let block_bytes = hex::decode(block_str).expect(&format!("bad block file {block_idx}"));
|
||||
let (_, block): BlockWrapper = minicbor::decode(&block_bytes[..])
|
||||
.expect(&format!("error decoding cbor for file {}", block_idx));
|
||||
.expect(&format!("error decoding cbor for file {block_idx}"));
|
||||
|
||||
let computed_slot = byron_epoch_slot_to_absolute(
|
||||
block.header.consensus_data.0.epoch,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue