Skip to content

Commit a07e37a

Browse files
authored
Fix: bytes were stored wrong (#340)
1 parent ae37e59 commit a07e37a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/database/sql_type_wrapper.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,12 @@ impl EthereumSqlTypeWrapper {
450450
.collect::<Vec<_>>()
451451
.join(", ")
452452
),
453-
EthereumSqlTypeWrapper::Bytes(value) => format!("0x{}", hex::encode(value)),
453+
EthereumSqlTypeWrapper::Bytes(value) => format!("'0x{}'", hex::encode(value)),
454454
EthereumSqlTypeWrapper::VecBytes(values) => format!(
455455
"[{}]",
456456
values
457457
.iter()
458-
.map(|v| format!("0x{}", hex::encode(v)))
458+
.map(|v| format!("'0x{}'", hex::encode(v)))
459459
.collect::<Vec<_>>()
460460
.join(", ")
461461
),
@@ -489,7 +489,7 @@ impl EthereumSqlTypeWrapper {
489489
EthereumSqlTypeWrapper::StringVarcharNullable(v) => v.to_string(),
490490
EthereumSqlTypeWrapper::StringCharNullable(v) => v.to_string(),
491491
EthereumSqlTypeWrapper::AddressNullable(v) => v.to_string(),
492-
EthereumSqlTypeWrapper::BytesNullable(v) => v.to_string(),
492+
EthereumSqlTypeWrapper::BytesNullable(v) => format!("'0x{}'", hex::encode(v)),
493493

494494
#[allow(deprecated)]
495495
EthereumSqlTypeWrapper::H160(v) => v.to_string(),

0 commit comments

Comments
 (0)