Closed DenisCarriere closed 3 months ago
Fixed by setting all values as String
and returning empty string as newValue
CREATE TABLE IF NOT EXISTS logs
(
topic0 String,
topic1 String,
topic2 String,
topic3 String,
pub fn extract_topic(topics: &Vec<Vec<u8>>, index: usize) -> String {
if index < topics.len() {
bytes_to_hex(topics[index].clone())
} else {
"".to_string()
}
}
{
"table": "logs",
"operation": "OPERATION_CREATE",
"fields": [
{
"name": "topic0",
"newValue": "0xdbccb92686efceafb9bb7e0394df7f58f71b954061b81afb57109bf247d3d75a"
},
{
"name": "topic1",
"newValue": "0x0000000000000000000000000c0f71f46f1f8f6beb301cc55a7e7ba55e8604f3"
},
{
"name": "topic2"
},
{
"name": "topic3"
},
{
"name": "tx_hash",
"newValue": "0x85621a86874614a218da822ef990a9c543ee1b25c678269644e0df956ba7b9df"
}
],
"compositePk": {
"keys": {
"tx_hash": "0x85621a86874614a218da822ef990a9c543ee1b25c678269644e0df956ba7b9df"
}
}
}
Same issue with
Nullable(String)
JSON with empty
newValue
❌ Error
unsupported pointer type *string
JSON with no
newValue
❌ Error
expected 5 arguments, got 2