Skip to content

Commit

Permalink
PLT-8221 - Port of golden tests (where applicable) (#222)
Browse files Browse the repository at this point in the history
* PLT-8221 - Port of golden tests (where applicable)

* PLT-8221 - Removed unnecessary dependencies

* PLT-8221 - Updated a name (sidechain -> chain-index)

* PLT-8221 - Trying to fix tests on CI build
  • Loading branch information
willjgould authored Oct 30, 2023
1 parent fead9d1 commit 830f9ea
Show file tree
Hide file tree
Showing 25 changed files with 761 additions and 1 deletion.
4 changes: 4 additions & 0 deletions marconi-chain-index/marconi-chain-index.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ test-suite marconi-chain-index-test
Spec.Marconi.ChainIndex.Api.Gen
Spec.Marconi.ChainIndex.Api.Routes
Spec.Marconi.ChainIndex.CLI
Spec.Marconi.ChainIndex.CLIInputValidation
Spec.Marconi.ChainIndex.Indexers
Spec.Marconi.ChainIndex.Indexers.BlockInfo
Spec.Marconi.ChainIndex.Indexers.ChainTip
Expand All @@ -252,6 +253,7 @@ test-suite marconi-chain-index-test
Spec.Marconi.ChainIndex.Indexers.UtxoQuery
Spec.Marconi.ChainIndex.Logger
Spec.Marconi.ChainIndex.Orphans
Spec.Marconi.ChainIndex.Utils

--------------------
-- Local components
Expand Down Expand Up @@ -284,12 +286,14 @@ test-suite marconi-chain-index-test
, plutus-ledger-api ^>=1.9
, plutus-tx
, plutus-tx-plugin
, process

------------------------
-- Non-IOG dependencies
------------------------
build-depends:
, aeson
, aeson-pretty
, async
, base >=4.9 && <5
, base16-bytestring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{-# LANGUAGE OverloadedStrings #-}

module Marconi.ChainIndex.Api.JsonRpc.Endpoint.CurrentSyncedBlock (
GetCurrentSyncedBlockResult (GetCurrentSyncedBlockResult),
RpcGetCurrentSyncedBlock,
getCurrentSyncedBlockHandler,
) where
Expand Down
6 changes: 5 additions & 1 deletion marconi-chain-index/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
module Main (main) where

import Spec.Marconi.ChainIndex.Api.Routes qualified as Api.Routes
import Spec.Marconi.ChainIndex.Api.Routes qualified as Routes
import Spec.Marconi.ChainIndex.CLI qualified as CLI
import Spec.Marconi.ChainIndex.CLIInputValidation qualified as CLIInput
import Spec.Marconi.ChainIndex.Indexers qualified as Indexers
import Spec.Marconi.ChainIndex.Logger qualified as Logger
import Spec.Marconi.ChainIndex.Orphans qualified as Orphans
Expand All @@ -16,7 +18,9 @@ tests :: TestTree
tests =
testGroup
"Marconi"
[ CLI.tests
[ Routes.tests
, CLIInput.tests
, CLI.tests
, Logger.tests
, Orphans.tests
, Api.Routes.tests
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --addresses-to-index: Invalid address (not a valid Bech32 address representation): "x8phkx6acpnf78fuvxn0mkew3l0fd058hzquvz7w36x4gt7r0vd4msrxnuwnccdxlhdjar77j6lg0wypcc9uar5d2shskhj42g"

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --addresses-to-index: Invalid address (not a valid Bech32 address representation): "notAnAddress"

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --addresses-to-index: Invalid address (not a valid Bech32 address representation): "stake1uyehkck0lajq8gr28t9uxnuvgcqrc6070x3k9r8048z8y5gh6ffgw"

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --addresses-to-index: Invalid address (not a valid Bech32 address representation): "stake_test17rphkx6acpnf78fuvxn0mkew3l0fd058hzquvz7w36x4gtcljw6kf"

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --addresses-to-index: Invalid address (not a valid Bech32 address representation): "addr1x8phkx6acpnf78fuvxn0mkew3l0fd058hzquvz7w36x4gt7r0vd4msrxnuwnccdxlhdjar77j6lg0wypcc9uar5d2shskhj42"

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Expected Base16-encoded bytestring, but got 0000notAToken0; invalid character at offset: 4

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Expected Base16-encoded bytestring, but got deadbeeef; invalid bytestring size

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Failed to deserialise deadbeef0000000000000000000000000000000000000000000000000000000000 as AssetName. Unable to deserialise AssetName (the bytestring should be no longer than 32 bytes long which corresponds to a hex representation of 64 characters)

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Failed to deserialise 1cdc58c3b6d1ab11dd047ac9e3a2ec26aabf0839abe37b791cb810f2f2 as PolicyId. Incorrect number of bytes

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Failed to deserialise 1cdc58c3b6d1ab11dd047ac9e3a2ec26aabf0839abe37b791cb810 as PolicyId. Incorrect number of bytes

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Expected Base16-encoded bytestring, but got 1cdc58c3b6d1ab11dd047ac9e3a2ec26aabf0839abe37b791cb810f2f; invalid bytestring size

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Expected Base16-encoded bytestring, but got 1cdc58c3b6d1ab11dd047ac9e3a2ec26aabf0839abe37b791cb810f; invalid bytestring size

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
option --match-asset-id: Expected Base16-encoded bytestring, but got 00aPolicyIdOfCorrectLength000000000000000000000000000000000000; invalid character at offset: 3

Usage: marconi-chain-index [--version] (-s|--socket-path FILE-PATH)
(--mainnet | --testnet-magic NATURAL)
[(-n|--slot-no SLOT-NO)
(-b|--block-header-hash BLOCK-HEADER-HASH)]
[--max-indexing-depth | --min-indexing-depth NATURAL]
[--initial-retry-time NATURAL]
[--no-max-retry-time | --max-retry-time NATURAL]
(-d|--db-dir DIR) [--enable-txoutref]
[--disable-utxo] [--disable-address-datum]
[--disable-script-tx]
[--disable-epoch-stakepool-size] [--disable-mintburn]
[--http-port INT]
[(-a|--addresses-to-index BECH32-ADDRESS)]
[(--match-asset-id POLICY_ID[.ASSET_NAME])]
[--node-config-path ARG]
[--fail-if-resyncing-from-genesis]

marconi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"blockHeaderHash": null,
"blockNo": null,
"nodeTip": null,
"slotNo": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"blockHeaderHash": "6161616161616161616161616161616161616161616161616161616161616161",
"blockNo": 64903,
"nodeTip": {
"blockHeaderHash": "6161616161616161616161616161616161616161616161616161616161616161",
"blockNo": 64903,
"slotNo": 1
},
"slotNo": 1
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"_nonceBlockNo": 21645,
"_nonceEpochNo": 2,
"_nonceNonce": {
"contents": "ce4a80f49c44c21d7114d93fe5f992a2f9de6bad4a03a5df7e7403004ebe16fc",
"tag": "Nonce"
}
}
Loading

0 comments on commit 830f9ea

Please sign in to comment.