docs(indexing): add special notice for pool_id

This commit is contained in:
Florian Pellissier
2024-08-20 11:32:01 +02:00
parent c7b1796f7d
commit 28dee5e7b7

View File

@@ -6,26 +6,6 @@ Certain attribute names are reserved exclusively for specific purposes. Please u
The following attributes names are reserved and must be given using `ProtocolComponent.static_att`. These attributes MUST be immutable. If it can ever change, it should be given as a state attribute (see below) for this component id. The following attributes names are reserved and must be given using `ProtocolComponent.static_att`. These attributes MUST be immutable. If it can ever change, it should be given as a state attribute (see below) for this component id.
- ### <u>**pool_id**</u>
#### Description
The `pool_id` static attribute is used to specify the identifier of the pool when it differs from the `ProtocolComponent.id`. For example, Balancer pools have a component ID that corresponds to their contract address, and a separate pool ID used for registration on the Balancer Vault contract.
#### Type
This attribute value must be provided as a UTF-8 encoded string in bytes.
#### Example Usage
```rust
Attribute {
name: "pool_id".to_string(),
value: format!("0x{}", hex::encode(pool_registered.pool_id)).as_bytes(),
change: ChangeType::Creation.into(),
}
```
- ### <u>**manual_updates**</u> - ### <u>**manual_updates**</u>
#### Description #### Description
@@ -48,6 +28,28 @@ change: ChangeType::Creation.into(),
} }
``` ```
- ### <u>**pool_id**</u>
#### Description
The `pool_id` static attribute is used to specify the identifier of the pool when it differs from the `ProtocolComponent.id`. For example, Balancer pools have a component ID that corresponds to their contract address, and a separate pool ID used for registration on the Balancer Vault contract.
**Notice**: In most of the cases, using `ProtocolComponent.id` directly is preferred over `pool_id`.
#### Type
This attribute value must be provided as a UTF-8 encoded string in bytes.
#### Example Usage
```rust
Attribute {
name: "pool_id".to_string(),
value: format!("0x{}", hex::encode(pool_registered.pool_id)).as_bytes(),
change: ChangeType::Creation.into(),
}
```
## State Attributes ## State Attributes
The following attributes names are reserved and must be given using `EntityChanges`. Unlike [Static Attributes](#static-attributes), state attributes are used for dynamic attributes and are allowed to change at anytime. The following attributes names are reserved and must be given using `EntityChanges`. Unlike [Static Attributes](#static-attributes), state attributes are used for dynamic attributes and are allowed to change at anytime.