Skip to content

Commit

Permalink
feat: make v1 compatible with Conway era (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Aug 4, 2024
1 parent 5bf6b83 commit dc6168f
Show file tree
Hide file tree
Showing 19 changed files with 905 additions and 226 deletions.
116 changes: 79 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ authors = ["Santiago Carmuega <[email protected]>"]


[dependencies]
pallas = "0.18.2"
pallas-multiplexer = "0.18.2"
pallas-miniprotocols = "0.18.2"
pallas-primitives = "0.29.0"
pallas-traverse = "0.29.0"
pallas-addresses = "0.29.0"
pallas-codec = "0.29.0"
pallas-crypto = "0.29.0"
# pallas = { git = "https://github.com/txpipe/pallas" }
# pallas = { path = "../pallas/pallas" }
hex = "0.4.3"
Expand All @@ -30,6 +36,7 @@ strum = "0.24"
strum_macros = "0.24"
prometheus_exporter = { version = "0.8.5", default-features = false }
unicode-truncate = "0.2.0"
time = "0.3.36"

# feature logs
file-rotate = { version = "0.7.1", optional = true }
Expand Down Expand Up @@ -63,7 +70,7 @@ redis = { version = "0.21.6", optional = true, features = ["tokio-comp"] }

# features: gcp

google-cloud-gax = {version ="0.17.0", optional = true }
google-cloud-gax = { version = "0.17.0", optional = true }
google-cloud-pubsub = { version = "0.23.0", optional = true }
google-cloud-googleapis = { version = "0.12.0", optional = true }

Expand All @@ -80,5 +87,5 @@ elasticsink = ["elasticsearch", "tokio"]
fingerprint = ["murmur3"]
aws = ["aws-config", "aws-sdk-sqs", "aws-sdk-lambda", "aws-sdk-s3", "tokio"]
redissink = ["redis", "tokio"]
gcp = ["google-cloud-pubsub", "google-cloud-googleapis", "tokio", "web" ,"google-cloud-gax"]
gcp = ["google-cloud-pubsub", "google-cloud-googleapis", "tokio", "web", "google-cloud-gax"]
rabbitmqsink = ["lapin", "tokio"]
12 changes: 6 additions & 6 deletions src/mapper/babbage.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use pallas::codec::utils::KeepRaw;
use pallas_codec::utils::KeepRaw;

use pallas::ledger::primitives::babbage::{
use pallas_primitives::babbage::{
AuxiliaryData, MintedBlock, MintedDatumOption, MintedPostAlonzoTransactionOutput,
MintedTransactionBody, MintedTransactionOutput, MintedWitnessSet, NetworkId,
};

use pallas::crypto::hash::Hash;
use pallas::ledger::traverse::OriginalHash;
use pallas_crypto::hash::Hash;
use pallas_traverse::OriginalHash;

use crate::model::{BlockRecord, Era, TransactionRecord};
use crate::utils::time::TimeProvider;
Expand Down Expand Up @@ -199,7 +199,7 @@ impl EventWriter {
let record = self.to_post_alonzo_output_record(output)?;
self.append(record.into())?;

let address = pallas::ledger::addresses::Address::from_bytes(&output.address)?;
let address = pallas_addresses::Address::from_bytes(&output.address)?;

let child = &self.child_writer(EventContext {
output_address: address.to_string().into(),
Expand Down Expand Up @@ -389,7 +389,7 @@ impl EventWriter {
/// Entry-point to start crawling a blocks for events. Meant to be used when
/// we haven't decoded the CBOR yet (for example, N2N).
pub fn crawl_from_babbage_cbor(&self, cbor: &[u8]) -> Result<(), Error> {
let (_, block): (u16, MintedBlock) = pallas::codec::minicbor::decode(cbor)?;
let (_, block): (u16, MintedBlock) = pallas_codec::minicbor::decode(cbor)?;
self.crawl_babbage_with_cbor(&block, cbor)
}
}
Loading

0 comments on commit dc6168f

Please sign in to comment.