docs(substreams): miscellaneous docs improvements and update

This commit is contained in:
Florian Pellissier
2024-08-16 15:22:27 +02:00
parent bc2cd6bab2
commit 37f1fbfe04
6 changed files with 137 additions and 103 deletions

View File

@@ -22,3 +22,6 @@ the package you'd like to pre release. This will create a
`[package]-[semver].pre-[commit-sha]` release in our spkg repository which you can use
to run the substream´.
## Test your implementation
To run a full end-to-end integration test you can refer to the [testing script documentation](../testing/README.md)

View File

@@ -1,19 +1,36 @@
# Name of the substreams config file in your substreams module. Usually "./substreams.yaml"
substreams_yaml_path: ./substreams.yaml
adapter_contract: "SwapAdapter.evm.runtime"
# Name of the adapter contract, usually: ProtocolSwapAdapter"
adapter_contract: "SwapAdapter"
# Constructor signature of the Adapter contract"
adapter_build_signature: "constructor(address)"
# A comma separated list of args to be passed to the contructor of the Adapter contract"
adapter_build_args: "0x0000000000000000000000000000000000000000"
# Whether or not the testing script should skip checking balances of the protocol components.
# If set to `true` please always add a reason why it's skipped.
skip_balance_check: false
# A list of accounts that need to be indexed to run the tests properly.
# Usually used when there is a global component required by all pools and created before the tested range of blocks. For example a factory or a vault.
# Please note that this component needs to be indexed by your substreams module, this feature is only for testing purpose.
# Also please always add a reason why this account is needed for your tests.
# This will be applied to each test.
initialized_accounts:
- "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84" # Needed for ....
# A list of protocol types names created by your Substreams module.
protocol_type_names:
- "type_name_1"
- "type_name_2"
# A list of tests.
tests:
# Name of the test
- name: test_pool_creation
# Indexed block range
start_block: 123
stop_block: 456
# Same as global `initialized_accounts` but only scoped to this test.
initialized_accounts:
- "0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963" # Needed for ....
# A list of expected component indexed in the block range. Each component must match perfectly the `ProtocolComponent` indexed by your subtreams module.
expected_components:
- id: "0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7"
tokens:
@@ -24,6 +41,8 @@ tests:
attr_1: "value"
attr_2: "value"
creation_tx: "0x20793bbf260912aae189d5d261ff003c9b9166da8191d8f9d63ff1c7722f3ac6"
# Whether or not the script should skip trying to simulate a swap on this component.
# If set to `true` please always add a reason why it's skipped.
skip_simulation: false
- name: test_something_else
start_block: 123
@@ -35,4 +54,4 @@ tests:
- "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84"
static_attributes: null
creation_tx: "0xfac67ecbd423a5b915deff06045ec9343568edaec34ae95c43d35f2c018afdaa"
skip_simulation: true # If true, always add a reason
skip_simulation: true # If true, always add a reason