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
Add support for various reducers #11
Add support for various reducers #11
Conversation
6bffe91
to
73a1f3c
Compare
&mut self, | ||
tx: &alonzo::TransactionBody, | ||
) -> Result<(), gasket::error::Error> { | ||
let is_smart_contract_transaction = tx.iter() |
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.
@scarmuega is there any more clever way to check if a transaction is in fact smart contract transaction?
Right now I am checking if any of the output addresses is in fact smart contract type of address, there could be a more clever way I guess..
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.
I found this:
pub enum TransactionBodyComponent {
Inputs(MaybeIndefArray<TransactionInput>),
Outputs(MaybeIndefArray<TransactionOutput>),
Fee(u64),
Ttl(u64),
Certificates(MaybeIndefArray<Certificate>),
Withdrawals(KeyValuePairs<RewardAccount, Coin>),
Update(Update),
AuxiliaryDataHash(ByteVec),
ValidityIntervalStart(u64),
Mint(Multiasset<i64>),
ScriptDataHash(Hash<32>),
Collateral(MaybeIndefArray<TransactionInput>),
RequiredSigners(MaybeIndefArray<AddrKeyhash>),
NetworkId(NetworkId),
}
ScriptDataHash -> will this be empty if this is not smart contract transaction?
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.
Depends on what you mean by "Smart contract transaction". If you are looking for transactions that execute scripts, then you need to look at input-related components, since script execution only takes place when you're consuming a UTxO that's sitting on a script address. A way of doing this is checking for redeemers in the witness set.
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.
I want to count all interactions with a smart contract address:
e.g.
addr1w999n67e86jn6xal07pzxtrmqynspgx0fwmcmpua4wc6yzsxpljz3
https://cardanoscan.io/address/addr1w999n67e86jn6xal07pzxtrmqynspgx0fwmcmpua4wc6yzsxpljz3
Transaction Count | | 3372792
Introduces PNCounter and