Conversation
|
I could get the correct information to |
|
I had the same issue, when something is part of cfg unstable, linter skips this in vscode (rust-analyzer) |
|
if you're using VSCode, try adding |
|
|
||
| pub struct Reducer { | ||
| config: Config, | ||
| address_hrp: String, |
There was a problem hiding this comment.
I don't think you need address_hrp for anything, probably copy and paste.
| tx: &alonzo::TransactionWitnessSet, | ||
| output: &mut super::OutputPort, | ||
| ) -> Result<(), gasket::error::Error> { | ||
| if let Some(plutus_scripts) = &tx.plutus_script { |
There was a problem hiding this comment.
Your code is iterative but actually the way one should write this IMHO is that rather than returning OK at the end, one should rather map and collect all results and return them from this function. Now I am by far a Rust noob but perhaps Rust will take a first item out of all results or evaluate lazily and stop execution and return result on first error.
@scarmuega do you agree?
There was a problem hiding this comment.
Yes it return result on first error if we use the ? operator
There was a problem hiding this comment.
Interesting operator... this is what I thought but you confirmed it.
Powerful and confusing operator.
| cbor: PlutusScript, | ||
| output: &mut super::OutputPort, | ||
| ) -> Result<(), gasket::error::Error> { | ||
| let key = format!("{}", hash); |
There was a problem hiding this comment.
it looks like you are ignoring a configuration key (prefix)
In progress
LastWriteWinsCRDT#[cfg(feature = "unstable")]as it was skipping some stuff in my linter