Skip to content

Commit

Permalink
add transaction history drep filters
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Mar 28, 2024
1 parent 94733f0 commit 76a0efe
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
36 changes: 32 additions & 4 deletions indexer/tasks/src/multiera/multiera_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,44 @@ fn queue_certificate(
}
}
}
MultiEraCertificate::VoteDelegCert(_) => {}
MultiEraCertificate::VoteDelegCert(cert) => {
let operator_credential = cert.stake_credential.to_raw_bytes().to_vec();
vkey_relation_map.add_relation(
tx_id,
&operator_credential,
TxCredentialRelationValue::DrepStakeDelegation,
);
}
MultiEraCertificate::StakeVoteDelegCert(_) => {}
MultiEraCertificate::StakeRegDelegCert(_) => {}
MultiEraCertificate::VoteRegDelegCert(_) => {}
MultiEraCertificate::StakeVoteRegDelegCert(_) => {}
MultiEraCertificate::AuthCommitteeHotCert(_) => {}
MultiEraCertificate::ResignCommitteeColdCert(_) => {}
MultiEraCertificate::RegDrepCert(_) => {}
MultiEraCertificate::UnregDrepCert(_) => {}
MultiEraCertificate::UpdateDrepCert(_) => {}
MultiEraCertificate::RegDrepCert(cert) => {
let operator_credential = cert.drep_credential.to_raw_bytes().to_vec();
vkey_relation_map.add_relation(
tx_id,
&operator_credential,
TxCredentialRelationValue::Drep,
);
}
MultiEraCertificate::UnregDrepCert(cert) => {
let operator_credential = cert.drep_credential.to_raw_bytes().to_vec();
vkey_relation_map.add_relation(
tx_id,
&operator_credential,
TxCredentialRelationValue::Drep,
);
}
MultiEraCertificate::UpdateDrepCert(cert) => {
let operator_credential = cert.drep_credential.to_raw_bytes().to_vec();
vkey_relation_map.add_relation(
tx_id,
&operator_credential,
TxCredentialRelationValue::Drep,
);
}
};
}

Expand Down
4 changes: 4 additions & 0 deletions indexer/tasks/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub enum TxCredentialRelationValue {
Withdrawal,
RequiredSigner,
InNativeScript, // keyhash in scripts including mints
DrepStakeDelegation,
Drep,
}

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
Expand Down Expand Up @@ -56,6 +58,8 @@ impl From<TxCredentialRelationValue> for i32 {
TxCredentialRelationValue::UnusedOutputStake => 0b10000000000000000000,
TxCredentialRelationValue::ReferenceInput => 0b100000000000000000000,
TxCredentialRelationValue::ReferenceInputStake => 0b1000000000000000000000,
TxCredentialRelationValue::DrepStakeDelegation => 0b10000000000000000000000,
TxCredentialRelationValue::Drep => 0b100000000000000000000000,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions webserver/shared/models/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export enum RelationFilterType {
UnusedOutputStake = 0b10000000000000000000,
ReferenceInput = 0b100000000000000000000,
ReferenceInputStake = 0b1000000000000000000000,
DrepStakeDelegation = 0b10000000000000000000000,
Drep = 0b100000000000000000000000,
NO_FILTER = 0xff,
}

Expand Down

0 comments on commit 76a0efe

Please sign in to comment.