v0.1.0-pre.011
This commit is contained in:
@@ -764,7 +764,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn replay_input_rejects_empty_key() {
|
||||
let result = crate::CoreInstructionReplayInput::new(
|
||||
let result = crate::MdCoreInstructionReplayInput::new(
|
||||
" ",
|
||||
"abc",
|
||||
1,
|
||||
@@ -786,7 +786,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn replay_input_accepts_ordered_outer_instruction_array() {
|
||||
let result = crate::CoreInstructionReplayInput::new(
|
||||
let result = crate::MdCoreInstructionReplayInput::new(
|
||||
"abc:2",
|
||||
"abc",
|
||||
1,
|
||||
@@ -831,7 +831,7 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn replay_input_rejects_non_array_outer_instruction_context() {
|
||||
let result = crate::CoreInstructionReplayInput::new(
|
||||
let result = crate::MdCoreInstructionReplayInput::new(
|
||||
"abc:0",
|
||||
"abc",
|
||||
1,
|
||||
|
||||
@@ -54,7 +54,7 @@ pub struct DecodedEventInsert {
|
||||
impl DecodedEventInsert {
|
||||
/// Builds a decoded event insert contract from the shared decoded model.
|
||||
pub fn from_model(
|
||||
event: &kb_lib::DecodedProtocolEvent,
|
||||
event: &kb_lib::MdDecodedProtocolEvent,
|
||||
payload_json: serde_json::Value,
|
||||
) -> kb_core::Result<Self> {
|
||||
if event.signature.0.trim().is_empty() {
|
||||
|
||||
@@ -107,7 +107,7 @@ impl RawTransactionInsert {
|
||||
}
|
||||
|
||||
/// Builds a storage insert from the source-independent canonical transaction model.
|
||||
pub fn from_canonical(transaction: &kb_lib::CanonicalTransaction) -> kb_core::Result<Self> {
|
||||
pub fn from_canonical(transaction: &kb_lib::MdCanonicalTransaction) -> kb_core::Result<Self> {
|
||||
let canonical_json_result = transaction.to_canonical_json();
|
||||
let canonical_json = match canonical_json_result {
|
||||
std::result::Result::Ok(value) => value,
|
||||
@@ -498,18 +498,18 @@ mod tests {
|
||||
assert!(result.is_err());
|
||||
}
|
||||
|
||||
fn canonical_transaction_fixture() -> kb_lib::CanonicalTransaction {
|
||||
return kb_lib::CanonicalTransaction {
|
||||
format_version: kb_lib::CANONICAL_TRANSACTION_FORMAT_VERSION,
|
||||
fn canonical_transaction_fixture() -> kb_lib::MdCanonicalTransaction {
|
||||
return kb_lib::MdCanonicalTransaction {
|
||||
format_version: kb_lib::MD_CANONICAL_TRANSACTION_FORMAT_VERSION,
|
||||
primary_signature: "2Ana1pUpv2ZbMVkwF5FXapYeBEjdxDatLn7nvJkhgTSXbs59SyZSx866bXirPgj8QQVB57uxHJBG1YFvkRbFj4T".to_string(),
|
||||
slot: 9,
|
||||
block_time: std::option::Option::None,
|
||||
version: kb_lib::CanonicalTransactionVersion::Legacy,
|
||||
version: kb_lib::MdCanonicalTransactionVersion::Legacy,
|
||||
signatures: std::vec![
|
||||
"2Ana1pUpv2ZbMVkwF5FXapYeBEjdxDatLn7nvJkhgTSXbs59SyZSx866bXirPgj8QQVB57uxHJBG1YFvkRbFj4T".to_string(),
|
||||
],
|
||||
message: kb_lib::CanonicalTransactionMessage {
|
||||
header: kb_lib::CanonicalMessageHeader {
|
||||
message: kb_lib::MdCanonicalTransactionMessage {
|
||||
header: kb_lib::MdCanonicalMessageHeader {
|
||||
num_required_signatures: 1,
|
||||
num_readonly_signed_accounts: 0,
|
||||
num_readonly_unsigned_accounts: 1,
|
||||
@@ -519,17 +519,17 @@ mod tests {
|
||||
"ComputeBudget111111111111111111111111111111".to_string(),
|
||||
],
|
||||
recent_blockhash: "11111111111111111111111111111111".to_string(),
|
||||
instructions: std::vec![kb_lib::CanonicalCompiledInstruction {
|
||||
instructions: std::vec![kb_lib::MdCanonicalCompiledInstruction {
|
||||
program_id_index: 1,
|
||||
account_indexes: std::vec![0],
|
||||
data_base64: "AQ==".to_string(),
|
||||
stack_height: std::option::Option::Some(1),
|
||||
}],
|
||||
address_table_lookups: std::vec::Vec::new(),
|
||||
loaded_addresses: kb_lib::CanonicalLoadedAddresses::default(),
|
||||
loaded_addresses: kb_lib::MdCanonicalLoadedAddresses::default(),
|
||||
},
|
||||
metadata: std::option::Option::Some(kb_lib::CanonicalTransactionMetadata {
|
||||
status: kb_lib::CanonicalTransactionStatus::Success,
|
||||
metadata: std::option::Option::Some(kb_lib::MdCanonicalTransactionMetadata {
|
||||
status: kb_lib::MdCanonicalTransactionStatus::Success,
|
||||
error: std::option::Option::None,
|
||||
fee: 5000,
|
||||
pre_balances: std::vec![10000, 1],
|
||||
@@ -556,7 +556,10 @@ mod tests {
|
||||
};
|
||||
assert_eq!(insert.signature, transaction.primary_signature);
|
||||
assert_eq!(insert.slot, transaction.slot);
|
||||
assert_eq!(insert.canonical_format_version, kb_lib::CANONICAL_TRANSACTION_FORMAT_VERSION);
|
||||
assert_eq!(
|
||||
insert.canonical_format_version,
|
||||
kb_lib::MD_CANONICAL_TRANSACTION_FORMAT_VERSION
|
||||
);
|
||||
assert_eq!(insert.canonical_json_hash.as_deref().map(|value| return value.len()), Some(64));
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ pub trait RawTransactionStore {
|
||||
/// Returns true when a canonical transaction signature is already stored.
|
||||
async fn has_raw_transaction_signature(
|
||||
&self,
|
||||
signature: &kb_lib::Signature,
|
||||
signature: &kb_lib::MdSignature,
|
||||
) -> kb_core::Result<bool>;
|
||||
|
||||
/// Returns true when a transaction observation key is already stored.
|
||||
@@ -99,7 +99,7 @@ pub trait CoreTransactionStore {
|
||||
&self,
|
||||
filter: &crate::CoreInstructionReplayFilter,
|
||||
page_request: &crate::PageRequest,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::CoreInstructionReplayInput>>;
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdCoreInstructionReplayInput>>;
|
||||
|
||||
/// Updates one normalized core instruction lifecycle state.
|
||||
async fn mark_core_instruction_lifecycle(
|
||||
@@ -144,7 +144,7 @@ pub trait DecodePipelineStore {
|
||||
async fn list_decode_inputs(
|
||||
&self,
|
||||
filter: &crate::DecodeSelectionFilter,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::CoreInstructionReplayInput>>;
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MdCoreInstructionReplayInput>>;
|
||||
|
||||
/// Returns true when the same processor version already succeeded for the same input hash.
|
||||
async fn is_decode_current(
|
||||
@@ -199,7 +199,7 @@ pub trait ProgramObservationStore {
|
||||
/// Stores program observations.
|
||||
async fn store_observations(
|
||||
&self,
|
||||
observations: &[kb_lib::ProgramObservation],
|
||||
observations: &[kb_lib::MdProgramObservation],
|
||||
) -> kb_core::Result<crate::InsertOutcome>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user