From ddfd0b1688220db81dd10cf3637384f272d23b79 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 0a4556581..30c46fbd0 100644 --- a/zilliqa/src/precompiles/scilla.rs +++ b/zilliqa/src/precompiles/scilla.rs @@ -150,7 +150,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")); }