Package org.ethereum.util

Examples of org.ethereum.util.RLPElement


    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;
  }
View Full Code Here

TOP

Related Classes of org.ethereum.util.RLPElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.