From 93e480d3da4bc5410cb2c18670479edbe0f5d3a1 Mon Sep 17 00:00:00 2001 From: Richard Watts Date: Wed, 15 Jan 2025 17:48:22 +0000 Subject: [PATCH] (fix) Pass strings to scilla as strings, rather than arrays of their bytes. --- zilliqa/src/precompiles/scilla.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zilliqa/src/precompiles/scilla.rs b/zilliqa/src/precompiles/scilla.rs index c5437213cf..d78ef4db5f 100644 --- a/zilliqa/src/precompiles/scilla.rs +++ b/zilliqa/src/precompiles/scilla.rs @@ -181,7 +181,7 @@ fn read_index(ty: ScillaType, d: &mut Decoder) -> Result> { ScillaType::Uint64 => serde_json::to_vec(&u64::detokenize(d.decode()?).to_string())?, ScillaType::Uint128 => serde_json::to_vec(&u128::detokenize(d.decode()?).to_string())?, ScillaType::Uint256 => serde_json::to_vec(&U256::detokenize(d.decode()?).to_string())?, - ScillaType::String => String::detokenize(d.decode()?).into_bytes(), + ScillaType::String => serde_json::to_vec(&String::detokenize(d.decode()?))?, ScillaType::Map(_, _) => { return Err(anyhow!("a map cannot be the key of another map")); }