Use generics in JSONHelper
This commit is contained in:
parent
33f887b76d
commit
4b790121b9
|
@ -2,11 +2,9 @@ package org.ethereum.json;
|
||||||
|
|
||||||
import org.ethereum.vm.DataWord;
|
import org.ethereum.vm.DataWord;
|
||||||
import org.json.simple.JSONArray;
|
import org.json.simple.JSONArray;
|
||||||
import org.json.simple.JSONObject;
|
|
||||||
import org.json.simple.JSONValue;
|
import org.json.simple.JSONValue;
|
||||||
import org.spongycastle.util.encoders.Hex;
|
import org.spongycastle.util.encoders.Hex;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,14 +16,12 @@ import java.util.*;
|
||||||
|
|
||||||
public class JSONHelper {
|
public class JSONHelper {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String dumpLine(byte[] address, byte[] nonce, byte[] balance, byte[] stateRoot,
|
public static String dumpLine(byte[] address, byte[] nonce, byte[] balance, byte[] stateRoot,
|
||||||
byte[] codeHash, byte[] code, Map<DataWord, DataWord> storageMap){
|
byte[] codeHash, byte[] code, Map<DataWord, DataWord> storageMap){
|
||||||
|
|
||||||
// {address: x, nonce: n1, balance: b1, stateRoot: s1, codeHash: c1, code: c2, sotrage: [key: k1, value: v1, key:k2, value: v2 ] }
|
// {address: x, nonce: n1, balance: b1, stateRoot: s1, codeHash: c1, code: c2, sotrage: [key: k1, value: v1, key:k2, value: v2 ] }
|
||||||
|
|
||||||
ArrayList<DataWord> storageKeys = new ArrayList(storageMap.keySet());
|
List<DataWord> storageKeys = new ArrayList<DataWord>(storageMap.keySet());
|
||||||
Collections.sort((List)storageKeys);
|
Collections.sort((List)storageKeys);
|
||||||
|
|
||||||
Map outMap = new LinkedHashMap();
|
Map outMap = new LinkedHashMap();
|
||||||
|
|
|
@ -6,12 +6,9 @@ package org.ethereum.trie;
|
||||||
* @author: Roman Mandeleil
|
* @author: Roman Mandeleil
|
||||||
* Created on: 11/06/2014 19:44
|
* Created on: 11/06/2014 19:44
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface TrieFacade {
|
public interface TrieFacade {
|
||||||
|
|
||||||
public void update(byte[] key, byte[] value);
|
public void update(byte[] key, byte[] value);
|
||||||
public byte[] get(byte[] key);
|
public byte[] get(byte[] key);
|
||||||
public void delete(byte[] key);
|
public void delete(byte[] key);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue