Skip to content

Commit

Permalink
fix: to_canonical_cbor_bytes -> to_cbor_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
gostkin committed Jan 30, 2024
1 parent 899f1e7 commit 6d5f5b0
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions indexer/tasks/src/multiera/dex/minswap_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Dex for MinSwapV1 {
.first()
{
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&datum.to_canonical_cbor_bytes(),
&datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let datum = pallas_datum.to_json();
Expand Down Expand Up @@ -86,7 +86,7 @@ impl Dex for MinSwapV1 {
.first()
{
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&main_datum.to_canonical_cbor_bytes(),
&main_datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let main_datum = pallas_datum.to_json();
Expand Down Expand Up @@ -120,7 +120,7 @@ impl Dex for MinSwapV1 {
&tx_witness.plutus_datums.clone().unwrap_or_default(),
) {
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&input_datum.to_canonical_cbor_bytes(),
&input_datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let input_datum = pallas_datum.to_json();
Expand Down
6 changes: 3 additions & 3 deletions indexer/tasks/src/multiera/dex/sundaeswap_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl Dex for SundaeSwapV1 {
.first()
{
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&datum.to_canonical_cbor_bytes(),
&datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let datum = pallas_datum.to_json();
Expand Down Expand Up @@ -86,7 +86,7 @@ impl Dex for SundaeSwapV1 {
.first()
{
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&main_datum.to_canonical_cbor_bytes(),
&main_datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let main_datum = pallas_datum.to_json();
Expand Down Expand Up @@ -119,7 +119,7 @@ impl Dex for SundaeSwapV1 {
&tx_witness.plutus_datums.clone().unwrap_or_default(),
) {
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&input_datum.to_canonical_cbor_bytes(),
&input_datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let input_datum = pallas_datum.to_json();
Expand Down
10 changes: 5 additions & 5 deletions indexer/tasks/src/multiera/dex/wingriders_v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl Dex for WingRidersV1 {
.first()
{
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&datum.to_canonical_cbor_bytes(),
&datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;
let datum = pallas_datum.to_json();
Expand Down Expand Up @@ -104,7 +104,7 @@ impl Dex for WingRidersV1 {
// Get pool input from redemeers
let pool_input_redeemer = redeemers.first().ok_or("No redeemers")?;
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&pool_input_redeemer.data.to_canonical_cbor_bytes(),
&pool_input_redeemer.data.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?;

Expand All @@ -119,7 +119,7 @@ impl Dex for WingRidersV1 {
.ok_or("Failed to find main redeemer")?;
let redeemer = redeemer.data.clone();
let pallas_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&redeemer.to_canonical_cbor_bytes(),
&redeemer.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode redeemer datum: {err}"))?;
let redeemer = pallas_datum.to_json();
Expand Down Expand Up @@ -159,7 +159,7 @@ impl Dex for WingRidersV1 {
.unwrap();

let parent_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&parent_datum.to_canonical_cbor_bytes(),
&parent_datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode datum: {err}"))?
.to_json();
Expand All @@ -182,7 +182,7 @@ impl Dex for WingRidersV1 {
)
.unwrap();
let input_datum = pallas::ledger::primitives::alonzo::PlutusData::decode_fragment(
&input_datum.to_canonical_cbor_bytes(),
&input_datum.to_cbor_bytes(),
)
.map_err(|err| format!("can't decode redeemer datum: {err}"))?
.to_json();
Expand Down
8 changes: 4 additions & 4 deletions indexer/tasks/src/multiera/multiera_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn queue_certificate(
// used for other options.
match cert {
MultiEraCertificate::StakeDelegation(delegation) => {
let credential = delegation.stake_credential.to_canonical_cbor_bytes();
let credential = delegation.stake_credential.to_cbor_bytes();

vkey_relation_map.add_relation(
tx_id,
Expand All @@ -155,7 +155,7 @@ fn queue_certificate(
);
}
MultiEraCertificate::StakeRegistration(registration) => {
let credential = registration.stake_credential.to_canonical_cbor_bytes();
let credential = registration.stake_credential.to_cbor_bytes();

vkey_relation_map.add_relation(
tx_id,
Expand All @@ -164,7 +164,7 @@ fn queue_certificate(
);
}
MultiEraCertificate::StakeDeregistration(deregistration) => {
let credential = deregistration.stake_credential.to_canonical_cbor_bytes();
let credential = deregistration.stake_credential.to_cbor_bytes();

vkey_relation_map.add_relation(
tx_id,
Expand Down Expand Up @@ -222,7 +222,7 @@ fn queue_certificate(
} = &mir.move_instantaneous_reward.action
{
for pair in to_stake_credentials.deref() {
let credential = pair.0.to_canonical_cbor_bytes();
let credential = pair.0.to_cbor_bytes();

vkey_relation_map.add_relation(
tx_id,
Expand Down
2 changes: 1 addition & 1 deletion indexer/tasks/src/multiera/multiera_address_delegation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async fn handle(
_ => continue,
};

let credential = credential.to_canonical_cbor_bytes();
let credential = credential.to_cbor_bytes();

let stake_credential_id = multiera_stake_credential
.get(&credential.to_vec())
Expand Down
4 changes: 2 additions & 2 deletions indexer/tasks/src/multiera/multiera_datum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async fn handle_datum(
.or_insert_with(|| cardano_transaction.id);
hash_to_data
.entry(hash)
.or_insert_with(|| datum.to_canonical_cbor_bytes());
.or_insert_with(|| datum.to_cbor_bytes());
}
for output in tx_body.outputs().iter() {
let output = match output {
Expand Down Expand Up @@ -106,7 +106,7 @@ async fn handle_datum(
.or_insert_with(|| cardano_transaction.id);
hash_to_data
.entry(hash)
.or_insert_with(|| datum.to_canonical_cbor_bytes());
.or_insert_with(|| datum.to_cbor_bytes());
}
};
}
Expand Down
2 changes: 1 addition & 1 deletion indexer/tasks/src/multiera/multiera_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async fn handle_metadata(
|((label, metadata), tx_id)| TransactionMetadataActiveModel {
tx_id: Set(*tx_id),
label: Set(label.to_le_bytes().to_vec()),
payload: Set(metadata.to_canonical_cbor_bytes()),
payload: Set(metadata.to_cbor_bytes()),
..Default::default()
},
),
Expand Down
2 changes: 1 addition & 1 deletion indexer/tasks/src/multiera/multiera_projected_nft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ fn get_projected_nft_redeemers(redeemers: &[Redeemer]) -> Result<BTreeMap<i64, R
continue;
}

match Redeem::try_from(redeemer.data.to_canonical_cbor_bytes().as_slice()) {
match Redeem::try_from(redeemer.data.to_cbor_bytes().as_slice()) {
Ok(redeem) => {
result.insert(redeemer.index as i64, redeem);
}
Expand Down
2 changes: 1 addition & 1 deletion indexer/tasks/src/multiera/multiera_txs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async fn handle_tx(
.enumerate()
.map(|(idx, tx)| {
let tx_payload = if include_payload {
tx.to_canonical_cbor_bytes()
tx.to_cbor_bytes()
} else {
vec![]
};
Expand Down
2 changes: 1 addition & 1 deletion indexer/tasks/src/multiera/multiera_used_outputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn queue_output(
queued_output.push(QueuedOutput {
payload: match output {
MultiEraTransactionOutput::Byron(byron) => byron.to_bytes(),
MultiEraTransactionOutput::Shelley(shelley) => shelley.to_canonical_cbor_bytes(),
MultiEraTransactionOutput::Shelley(shelley) => shelley.to_cbor_bytes(),
},
address: addr.to_raw_bytes().to_vec(),
tx_id,
Expand Down

0 comments on commit 6d5f5b0

Please sign in to comment.