Search in sources :

Example 1 with TxTouchedStorage

use of org.aion.mcf.core.TxTouchedStorage in project aion by aionnetwork.

the class AionTxExecSummary method decodeTouchedStorage.

protected static TxTouchedStorage decodeTouchedStorage(RLPElement encoded) {
    TxTouchedStorage result = new TxTouchedStorage();
    for (RLPElement entry : (RLPList) encoded) {
        RLPList asList = (RLPList) entry;
        DataWord key = new DataWord(asList.get(0).getRLPData());
        DataWord value = new DataWord(asList.get(1).getRLPData());
        byte[] changedBytes = asList.get(2).getRLPData();
        boolean changed = isNotEmpty(changedBytes) && RLP.decodeInt(changedBytes, 0) == 1;
        result.add(new TxTouchedStorage.Entry(key, value, changed));
    }
    return result;
}
Also used : TxTouchedStorage(org.aion.mcf.core.TxTouchedStorage) RLPElement(org.aion.rlp.RLPElement) DataWord(org.aion.mcf.vm.types.DataWord) RLPList(org.aion.rlp.RLPList)

Aggregations

TxTouchedStorage (org.aion.mcf.core.TxTouchedStorage)1 DataWord (org.aion.mcf.vm.types.DataWord)1 RLPElement (org.aion.rlp.RLPElement)1 RLPList (org.aion.rlp.RLPList)1