Merge pull request #24 from blockfrost/chore/go-staticcheck
chore(linter): add `go-staticcheck` to CI checks
chore(linter): add `go-staticcheck` to CI checks
Remove constructor tag verification from getScriptHashFromAddress and getPubKeyHashFromAddress. The ledger guarantees the correct credential type in both cases: the validated input is always a script address, and the beneficiary hash is checked against txInfoSignatories. Saves ~360K CPU / ~1.9K MEM.
Replace the nested Either SomeException (SubmitResult ...) with a single TxSubmitResult sum type with three constructors: TxSubmitSuccess, TxSubmitFail, and TxSubmitConnectionError. Callers now do one pattern match instead of a nested Either/SubmitResult combination.
fix: skip `blockfrost-platform` timestamps in the shared logs
This is an attempt at simplifying our snapshot-production process to be leaner and involve less tools. The current solutions requires a running node, Ogmios attached to it, and a script monitoring the whole. Plus, the data must be extracted while the node is syncing, which is not only unpractical to do repeatedly, but also quite brittle as it can sometimes fails due to concurrency issues (especially on mainnet, when building some of that data takes time). Plus, adding intermediaries like Ogmios in the loop, even if written in Haskell using the Cardano libraries, adds room for mistakes and discrepancies. There are already various transformations that are required on top of the raw ledger data, so it is better to reduce the surface and operate directly on the base data. Using the ledger state queries over the wire is unnecessary. The current commit only replaces the 'fetch.mjs' script, although the end goal is to produce the test vectors we currently produce using the 'generate.mjs' script (which combines data fetched from multiple epochs). As for the input snapshots, they can now be obtained from a working database using the db-analyzer (from ouroboros-consensus). Although this can take several hours on mainnet, it is easier to instrument than manually removing blocks from the immutable db and making queries while the node is syncing. Signed-off-by: KtorZ <[email protected]>
Replace the hand-rolled AnyPlutusScript GADT in Compatible/Read.hs with Cardano.Api.Experimental.Plutus.AnyPlutusScript. Update readFilePlutusScript to accept a ShelleyBasedEra era witness and return the era-parameterised experimental type directly. Simplify Compatible/Transaction/Run.hs and rewrite Compatible/Transaction/ScriptWitness.hs to use the experimental script witness API throughout, eliminating the old CertificateScriptWitness wrapper and all associated boilerplate.