Search in sources :

Example 6 with MerkleOptionalBlob

use of com.hedera.services.state.merkle.MerkleOptionalBlob in project hedera-services by hashgraph.

the class PojoFs method fromDisk.

public static PojoFs fromDisk(String dumpLoc) throws Exception {
    try (MerkleDataInputStream in = new MerkleDataInputStream(Files.newInputStream(Path.of(dumpLoc)))) {
        MerkleMap<String, MerkleOptionalBlob> fcm = in.readMerkleTree(Integer.MAX_VALUE);
        var pojo = from(fcm);
        return pojo;
    }
}
Also used : MerkleDataInputStream(com.swirlds.common.merkle.io.MerkleDataInputStream) MerkleOptionalBlob(com.hedera.services.state.merkle.MerkleOptionalBlob)

Example 7 with MerkleOptionalBlob

use of com.hedera.services.state.merkle.MerkleOptionalBlob in project hedera-services by hashgraph.

the class ReleaseTwentyTwoMigrationTest method setUp.

@BeforeEach
void setUp() throws IOException {
    TestFileUtils.blowAwayDirIfPresent(TEST_JDB_LOC);
    final String dataPath = "/0/f2";
    legacyBlobs.put(dataPath, new MerkleOptionalBlob(dataBlob));
    final String metadataPath = "/0/k3";
    legacyBlobs.put(metadataPath, new MerkleOptionalBlob(metadataBlob));
    final String bytecodePath = "/0/s4";
    legacyBlobs.put(bytecodePath, new MerkleOptionalBlob(bytecodeBlob));
    final String storagePath = "/0/d5";
    legacyBlobs.put(storagePath, new MerkleOptionalBlob(CommonUtils.unhex(contract5Storage)));
    final String expiryTimePath = "/0/e6";
    legacyBlobs.put(expiryTimePath, new MerkleOptionalBlob(expiryTimeBlob));
    final String missingStoragePath = "/0/d7";
    legacyBlobs.put(missingStoragePath, new MerkleOptionalBlob(CommonUtils.unhex(missingContractStorage)));
}
Also used : MerkleOptionalBlob(com.hedera.services.state.merkle.MerkleOptionalBlob) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

MerkleOptionalBlob (com.hedera.services.state.merkle.MerkleOptionalBlob)7 Test (org.junit.jupiter.api.Test)5 BlobStoragePipeline (com.swirlds.blob.internal.db.BlobStoragePipeline)2 MerkleMap (com.swirlds.merkle.map.MerkleMap)2 MerkleBlobMeta (com.hedera.services.state.merkle.MerkleBlobMeta)1 ClassConstructorPair (com.swirlds.common.constructable.ClassConstructorPair)1 MerkleDataInputStream (com.swirlds.common.merkle.io.MerkleDataInputStream)1 MerkleLong (com.swirlds.common.merkle.utility.MerkleLong)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1