|
|
@ -44,7 +44,8 @@ import org.apache.tuweni.bytes.Bytes32; |
|
|
|
|
|
|
|
|
|
|
|
public class TaskGenerator { |
|
|
|
public class TaskGenerator { |
|
|
|
|
|
|
|
|
|
|
|
public static List<Task<SnapDataRequest>> createAccountRequest(final boolean withData) { |
|
|
|
public static List<Task<SnapDataRequest>> createAccountRequest( |
|
|
|
|
|
|
|
final boolean withData, final boolean withNullTaskElement) { |
|
|
|
|
|
|
|
|
|
|
|
final BonsaiWorldStateKeyValueStorage worldStateKeyValueStorage = |
|
|
|
final BonsaiWorldStateKeyValueStorage worldStateKeyValueStorage = |
|
|
|
new BonsaiWorldStateKeyValueStorage( |
|
|
|
new BonsaiWorldStateKeyValueStorage( |
|
|
@ -91,7 +92,8 @@ public class TaskGenerator { |
|
|
|
rootHash, |
|
|
|
rootHash, |
|
|
|
accountHash, |
|
|
|
accountHash, |
|
|
|
stateTrieAccountValue.getStorageRoot(), |
|
|
|
stateTrieAccountValue.getStorageRoot(), |
|
|
|
withData); |
|
|
|
withData, |
|
|
|
|
|
|
|
withNullTaskElement); |
|
|
|
final BytecodeRequest bytecodeRequest = |
|
|
|
final BytecodeRequest bytecodeRequest = |
|
|
|
createBytecodeDataRequest( |
|
|
|
createBytecodeDataRequest( |
|
|
|
worldStateKeyValueStorage, |
|
|
|
worldStateKeyValueStorage, |
|
|
@ -112,7 +114,8 @@ public class TaskGenerator { |
|
|
|
final Hash rootHash, |
|
|
|
final Hash rootHash, |
|
|
|
final Hash accountHash, |
|
|
|
final Hash accountHash, |
|
|
|
final Bytes32 storageRoot, |
|
|
|
final Bytes32 storageRoot, |
|
|
|
final boolean withData) { |
|
|
|
final boolean withData, |
|
|
|
|
|
|
|
final boolean withNullTaskElement) { |
|
|
|
|
|
|
|
|
|
|
|
final RangeStorageEntriesCollector collector = |
|
|
|
final RangeStorageEntriesCollector collector = |
|
|
|
RangeStorageEntriesCollector.createCollector( |
|
|
|
RangeStorageEntriesCollector.createCollector( |
|
|
@ -140,6 +143,11 @@ public class TaskGenerator { |
|
|
|
request.setProofValid(true); |
|
|
|
request.setProofValid(true); |
|
|
|
request.addResponse(null, worldStateProofProvider, slots, new ArrayDeque<>()); |
|
|
|
request.addResponse(null, worldStateProofProvider, slots, new ArrayDeque<>()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (withNullTaskElement) { |
|
|
|
|
|
|
|
// setting isValidProof to true to simulate a null task element.
|
|
|
|
|
|
|
|
request.setProofValid(true); |
|
|
|
|
|
|
|
} |
|
|
|
return request; |
|
|
|
return request; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|