use of com.swirlds.common.merkle.utility.MerkleLong in project hedera-services by hashgraph.
the class AccountsReader method from.
public static MerkleMap<EntityNum, MerkleAccount> from(String loc) throws Exception {
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleLong.class, MerkleLong::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(FCQueue.class, FCQueue::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleMap.class, MerkleMap::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleEntityId.class, MerkleEntityId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(EntityId.class, EntityId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleAccount.class, MerkleAccount::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleAccountState.class, MerkleAccountState::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(ExpirableTxnRecord.class, ExpirableTxnRecord::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(TxnReceipt.class, TxnReceipt::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(TxnId.class, TxnId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(CurrencyAdjustments.class, CurrencyAdjustments::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(EvmFnResult.class, EvmFnResult::new));
try (MerkleDataInputStream in = new MerkleDataInputStream(Files.newInputStream(Path.of(loc)))) {
MerkleMap<EntityNum, MerkleAccount> fcm = in.readMerkleTree(Integer.MAX_VALUE);
return fcm;
}
}
use of com.swirlds.common.merkle.utility.MerkleLong in project hedera-services by hashgraph.
the class FcmToJsonUtil method convertStorageToJson.
@Test
void convertStorageToJson() throws Exception {
String[] round60Locs = { // "/Users/tinkerm/Dev/hgn3/hedera-services/hedera-node/n0-storage-round60.fcm",
"/Users/tinkerm/Dev/hgn3/hedera-services/hedera-node/n1-storage-round60.fcm" // "/Users/tinkerm/Dev/hgn3/hedera-services/hedera-node/n2-storage-round60.fcm",
// "/Users/tinkerm/Dev/hgn3/hedera-services/hedera-node/n3-storage-round60.fcm",
};
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleLong.class, MerkleLong::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleBlobMeta.class, MerkleBlobMeta::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleOptionalBlob.class, MerkleOptionalBlob::new));
for (String dumpLoc : round60Locs) {
System.out.println("Reading " + dumpLoc);
PojoFs.fromDisk(dumpLoc).asJsonTo(jsonSuffixed(dumpLoc));
}
}
use of com.swirlds.common.merkle.utility.MerkleLong in project hedera-services by hashgraph.
the class FcmToJsonUtil method convertAccountsToJson.
@Test
void convertAccountsToJson() throws Exception {
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleLong.class, MerkleLong::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(FCQueue.class, FCQueue::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleEntityId.class, MerkleEntityId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(EntityId.class, EntityId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleAccount.class, MerkleAccount::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(MerkleAccountState.class, MerkleAccountState::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(ExpirableTxnRecord.class, ExpirableTxnRecord::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(TxnReceipt.class, TxnReceipt::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(TxnId.class, TxnId::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(CurrencyAdjustments.class, CurrencyAdjustments::new));
ConstructableRegistry.registerConstructable(new ClassConstructorPair(EvmFnResult.class, EvmFnResult::new));
for (String dumpLoc : accountsLocs) {
PojoLedger.fromDisk(dumpLoc).asJsonTo(jsonSuffixed(dumpLoc));
}
}
Aggregations