Search in sources :

Example 6 with DatabaseType

use of org.aion.zero.impl.sync.DatabaseType in project aion by aionnetwork.

the class ResponseTrieDataTest method correct3Parameters.

/**
 * Parameters for testing:
 *
 * <ul>
 *   <li>{@link #testEncode_3Parameters_correct(ByteArrayWrapper, byte[], DatabaseType)}
 *   <li>{@link #testEncodeDecode_3Parameters(ByteArrayWrapper, byte[], DatabaseType)}
 * </ul>
 */
@SuppressWarnings("unused")
private Object correct3Parameters() {
    List<Object> parameters = new ArrayList<>();
    ByteArrayWrapper[] keyOptions = new ByteArrayWrapper[] { wrappedNodeKey, wrappedAltNodeKey, wrappedZeroNodeKey };
    byte[][] valueOptions = new byte[][] { leafValue, branchValue, extensionValue };
    DatabaseType[] dbOptions = new DatabaseType[] { STATE, STORAGE, DETAILS };
    // network and directory
    String[] net_values = new String[] { "mainnet", "invalid" };
    for (ByteArrayWrapper key : keyOptions) {
        for (byte[] value : valueOptions) {
            for (DatabaseType db : dbOptions) {
                parameters.add(new Object[] { key, value, db });
            }
        }
    }
    return parameters.toArray();
}
Also used : ByteArrayWrapper(org.aion.util.types.ByteArrayWrapper) DatabaseType(org.aion.zero.impl.sync.DatabaseType) ArrayList(java.util.ArrayList)

Aggregations

DatabaseType (org.aion.zero.impl.sync.DatabaseType)6 ByteArrayWrapper (org.aion.util.types.ByteArrayWrapper)4 ArrayList (java.util.ArrayList)3 RLPList (org.aion.rlp.RLPList)2 BigInteger (java.math.BigInteger)1 RLPElement (org.aion.rlp.RLPElement)1 RequestTrieData (org.aion.zero.impl.sync.msg.RequestTrieData)1 ResponseTrieData (org.aion.zero.impl.sync.msg.ResponseTrieData)1