Skip to content

Commit c6ed486

Browse files
committed
Bypass update_ibc_data
It returns empty array RLP.
1 parent 1b79c69 commit c6ed486

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

core/src/ibc/context.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,13 @@ impl<'a> KVStore for TopLevelKVStore<'a> {
8181
}
8282

8383
fn insert(&mut self, path: Path, value: &[u8]) -> Option<Bytes> {
84+
// FIXME: the update_ibc_data returns the previous data.
85+
// When the previous data is empty, it should return None.
86+
// Currently it is returning an empty RLP array.
87+
let prev = self.get(path);
8488
let key = TopLevelKVStore::key(path);
85-
self.state.update_ibc_data(&key, value.to_vec()).expect("Set in IBC KVStore").map(Bytes::from)
89+
self.state.update_ibc_data(&key, value.to_vec()).expect("Set in IBC KVStore");
90+
prev
8691
}
8792

8893
fn remove(&mut self, path: Path) -> Option<Bytes> {

0 commit comments

Comments
 (0)