RLPList data = RLP.decode2(rlpCode);
RLPList rlpList = (RLPList) data.get(0);
RLPList keys = (RLPList) rlpList.get(0);
RLPList values = (RLPList) rlpList.get(1);
RLPElement code = (RLPElement) rlpList.get(2);
if (keys.size() > 0) {
storageKeys = new ArrayList<>();
storageValues = new ArrayList<>();
}
for (int i = 0; i < keys.size(); ++i) {
RLPItem rlpItem = (RLPItem) keys.get(i);
storageKeys.add(new DataWord(rlpItem.getRLPData()));
}
for (int i = 0; i < values.size(); ++i) {
RLPItem rlpItem = (RLPItem) values.get(i);
storageValues.add(new DataWord(rlpItem.getRLPData()));
}
for (int i = 0; i < keys.size(); ++i) {
DataWord key = storageKeys.get(i);
DataWord value = storageValues.get(i);
storageTrie.update(key.getData(), RLP.encodeElement(value.getNoLeadZeroesData()));
}
this.code = code.getRLPData();
this.rlpEncoded = rlpCode;
}