-
Notifications
You must be signed in to change notification settings - Fork 5
Add intent field to BlockInfo #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -183,7 +183,7 @@ mod tests { | |
| protocol_params::NonceHash, | ||
| serialization::Bech32Conversion, | ||
| validation::{VrfLeaderValueTooBigError, WrongLeaderVrfKeyError}, | ||
| BlockHash, BlockStatus, Era, | ||
| BlockHash, BlockIntent, BlockStatus, Era, | ||
| }; | ||
|
|
||
| use super::*; | ||
|
|
@@ -206,6 +206,7 @@ mod tests { | |
| hex::decode(include_str!("./data/4490511.cbor")).unwrap(); | ||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate |
||
| slot: 4492800, | ||
| hash: BlockHash::try_from( | ||
| hex::decode("aa83acbf5904c0edfe4d79b3689d3d00fcfc553cf360fd2229b98d464c28e9de") | ||
|
|
@@ -258,6 +259,7 @@ mod tests { | |
| hex::decode(include_str!("./data/4556956.cbor")).unwrap(); | ||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
| slot: 5824849, | ||
| hash: BlockHash::try_from( | ||
| hex::decode("1038b2c76a23ea7d89cbd84d7744c97560eb3412661beed6959d748e24ff8229") | ||
|
|
@@ -316,6 +318,7 @@ mod tests { | |
| hex::decode(include_str!("./data/4576496.cbor")).unwrap(); | ||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
| slot: 6220749, | ||
| hash: BlockHash::try_from( | ||
| hex::decode("d78e446b6540612e161ebdda32ee1715ef0f9fc68e890c7e3aae167b0354f998") | ||
|
|
@@ -374,6 +377,7 @@ mod tests { | |
| hex::decode(include_str!("./data/4576496.cbor")).unwrap(); | ||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
| slot: 6220749, | ||
| hash: BlockHash::try_from( | ||
| hex::decode("d78e446b6540612e161ebdda32ee1715ef0f9fc68e890c7e3aae167b0354f998") | ||
|
|
@@ -433,6 +437,7 @@ mod tests { | |
| hex::decode(include_str!("./data/4576496.cbor")).unwrap(); | ||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
| slot: 6220749, | ||
| hash: BlockHash::try_from( | ||
| hex::decode("d78e446b6540612e161ebdda32ee1715ef0f9fc68e890c7e3aae167b0354f998") | ||
|
|
@@ -501,6 +506,7 @@ mod tests { | |
| hex::decode(include_str!("./data/4576496.cbor")).unwrap(); | ||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
| slot: 6220749, | ||
| hash: BlockHash::try_from( | ||
| hex::decode("d78e446b6540612e161ebdda32ee1715ef0f9fc68e890c7e3aae167b0354f998") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| use acropolis_common::{ | ||
| genesis_values::GenesisValues, | ||
| messages::{CardanoMessage, Message, RawBlockMessage}, | ||
| BlockHash, BlockInfo, BlockStatus, Era, | ||
| BlockHash, BlockInfo, BlockIntent, BlockStatus, Era, | ||
| }; | ||
| use anyhow::{anyhow, bail, Result}; | ||
| use caryatid_sdk::{module, Context}; | ||
|
|
@@ -329,6 +329,7 @@ impl MithrilSnapshotFetcher { | |
|
|
||
| let block_info = BlockInfo { | ||
| status: BlockStatus::Immutable, | ||
| intent: BlockIntent::Apply, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Originally thought this should be configurable but actually it will be consensus which sets the Validate bit if it wants to, so this is fine as is. |
||
| slot, | ||
| number, | ||
| hash: BlockHash::from(*block.hash()), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is a validator, shouldn't this be BlockIntent::Validate?