-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
There was an update to the-graph subgraph specVersion of 1.3.0, which added the Timeseries entity type.
The docs for the timeseries entity type require developers to set the timestamp property of the entity to Timestamp! type. Unfortunately, after looking in the source code of the LimeChain implementation that was used in matchstick, there is no Timestamp type support.
Here is LimeChain version: https://github.com/LimeChain/graph-node/blob/master/runtime/wasm/src/asc_abi/class.rs#L558-L574
impl StoreValueKind {
pub(crate) fn get_kind(value: &store::Value) -> StoreValueKind {
use self::store::Value;
match value {
Value::String(_) => StoreValueKind::String,
Value::Int(_) => StoreValueKind::Int,
Value::Int8(_) => StoreValueKind::Int8,
Value::BigDecimal(_) => StoreValueKind::BigDecimal,
Value::Bool(_) => StoreValueKind::Bool,
Value::List(_) => StoreValueKind::Array,
Value::Null => StoreValueKind::Null,
Value::Bytes(_) => StoreValueKind::Bytes,
Value::BigInt(_) => StoreValueKind::BigInt,
}
}
}Here is the-graph version: https://github.com/graphprotocol/graph-node/blob/master/runtime/wasm/src/asc_abi/class.rs#L580-L597
impl StoreValueKind {
pub(crate) fn get_kind(value: &store::Value) -> StoreValueKind {
use self::store::Value;
match value {
Value::String(_) => StoreValueKind::String,
Value::Int(_) => StoreValueKind::Int,
Value::Int8(_) => StoreValueKind::Int8,
Value::Timestamp(_) => StoreValueKind::Timestamp,
Value::BigDecimal(_) => StoreValueKind::BigDecimal,
Value::Bool(_) => StoreValueKind::Bool,
Value::List(_) => StoreValueKind::Array,
Value::Null => StoreValueKind::Null,
Value::Bytes(_) => StoreValueKind::Bytes,
Value::BigInt(_) => StoreValueKind::BigInt,
}
}
}After trying to set the entity's timestamp as Timestamp! type and save the entity, the matchstick runtime gives such error:
let vaultSnapshot = new VaultSnapshot(0);
vaultSnapshot.timestamp = params.timestamp.toI64();
vaultSnapshot.save(); // <-- herethread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other(value 9 is out of range for StoreValueKind)', src/context/mod.rs:183:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
› Error: Matchstick exited with an errorReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels