|
|
@ -18,7 +18,6 @@ import org.hyperledger.besu.datatypes.Address; |
|
|
|
import org.hyperledger.besu.datatypes.Hash; |
|
|
|
import org.hyperledger.besu.datatypes.Hash; |
|
|
|
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; |
|
|
|
import org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider; |
|
|
|
import org.hyperledger.besu.ethereum.core.TrieGenerator; |
|
|
|
import org.hyperledger.besu.ethereum.core.TrieGenerator; |
|
|
|
import org.hyperledger.besu.ethereum.eth.sync.snapsync.SnapWorldDownloadState; |
|
|
|
|
|
|
|
import org.hyperledger.besu.ethereum.rlp.RLP; |
|
|
|
import org.hyperledger.besu.ethereum.rlp.RLP; |
|
|
|
import org.hyperledger.besu.ethereum.storage.StorageProvider; |
|
|
|
import org.hyperledger.besu.ethereum.storage.StorageProvider; |
|
|
|
import org.hyperledger.besu.ethereum.trie.MerkleTrie; |
|
|
|
import org.hyperledger.besu.ethereum.trie.MerkleTrie; |
|
|
@ -42,13 +41,11 @@ import org.junit.jupiter.params.ParameterizedTest; |
|
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
|
import org.junit.jupiter.params.provider.Arguments; |
|
|
|
import org.junit.jupiter.params.provider.ArgumentsProvider; |
|
|
|
import org.junit.jupiter.params.provider.ArgumentsProvider; |
|
|
|
import org.junit.jupiter.params.provider.ArgumentsSource; |
|
|
|
import org.junit.jupiter.params.provider.ArgumentsSource; |
|
|
|
import org.mockito.Mock; |
|
|
|
|
|
|
|
import org.mockito.junit.jupiter.MockitoExtension; |
|
|
|
import org.mockito.junit.jupiter.MockitoExtension; |
|
|
|
|
|
|
|
|
|
|
|
@ExtendWith(MockitoExtension.class) |
|
|
|
@ExtendWith(MockitoExtension.class) |
|
|
|
class StorageTrieNodeHealingRequestTest { |
|
|
|
class StorageTrieNodeHealingRequestTest { |
|
|
|
|
|
|
|
|
|
|
|
@Mock private SnapWorldDownloadState downloadState; |
|
|
|
|
|
|
|
final List<Address> accounts = |
|
|
|
final List<Address> accounts = |
|
|
|
List.of( |
|
|
|
List.of( |
|
|
|
Address.fromHexString("0xdeadbeef"), |
|
|
|
Address.fromHexString("0xdeadbeef"), |
|
|
@ -102,8 +99,7 @@ class StorageTrieNodeHealingRequestTest { |
|
|
|
new StorageTrieNodeHealingRequest( |
|
|
|
new StorageTrieNodeHealingRequest( |
|
|
|
account0StorageRoot, account0Hash, Hash.EMPTY, Bytes.EMPTY); |
|
|
|
account0StorageRoot, account0Hash, Hash.EMPTY, Bytes.EMPTY); |
|
|
|
|
|
|
|
|
|
|
|
Assertions.assertThat(request.getExistingData(downloadState, worldStateStorageCoordinator)) |
|
|
|
Assertions.assertThat(request.getExistingData(worldStateStorageCoordinator)).isPresent(); |
|
|
|
.isPresent(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@ParameterizedTest |
|
|
@ -113,7 +109,6 @@ class StorageTrieNodeHealingRequestTest { |
|
|
|
final StorageTrieNodeHealingRequest request = |
|
|
|
final StorageTrieNodeHealingRequest request = |
|
|
|
new StorageTrieNodeHealingRequest(Hash.EMPTY, account0Hash, Hash.EMPTY, Bytes.EMPTY); |
|
|
|
new StorageTrieNodeHealingRequest(Hash.EMPTY, account0Hash, Hash.EMPTY, Bytes.EMPTY); |
|
|
|
|
|
|
|
|
|
|
|
Assertions.assertThat(request.getExistingData(downloadState, worldStateStorageCoordinator)) |
|
|
|
Assertions.assertThat(request.getExistingData(worldStateStorageCoordinator)).isEmpty(); |
|
|
|
.isEmpty(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|