use of com.hedera.services.ledger.properties.ChangeSummaryManager in project hedera-services by hashgraph.
the class TransactionalLedgerTest method setup.
@BeforeEach
private void setup() {
scopedCheck = new TestAccountScopedCheck();
accountsLedger = new TransactionalLedger<>(AccountProperty.class, MerkleAccount::new, backingAccounts, new ChangeSummaryManager<>());
final var accountsCommitInterceptor = new AccountsCommitInterceptor(new SideEffectsTracker());
accountsLedger.setCommitInterceptor(accountsCommitInterceptor);
subject = new TransactionalLedger<>(TestAccountProperty.class, TestAccount::new, backingTestAccounts, changeManager);
final var testAccountCommitInterceptor = new TestAccountCommitInterceptor(new SideEffectsTracker());
subject.setCommitInterceptor(testAccountCommitInterceptor);
}
use of com.hedera.services.ledger.properties.ChangeSummaryManager in project hedera-services by hashgraph.
the class LedgerBalanceChangesTest method setUp.
@BeforeEach
void setUp() throws ConstructableRegistryException {
MockitoAnnotations.initMocks(this);
accountsLedger = new TransactionalLedger<>(AccountProperty.class, MerkleAccount::new, backingAccounts, new ChangeSummaryManager<>());
accountsLedger.setCommitInterceptor(accountsCommitInterceptor);
tokenRelsLedger = new TransactionalLedger<>(TokenRelProperty.class, MerkleTokenRelStatus::new, backingRels, new ChangeSummaryManager<>());
nftsLedger = new TransactionalLedger<>(NftProperty.class, MerkleUniqueToken::new, backingNfts, new ChangeSummaryManager<>());
nftsLedger.setCommitInterceptor(uniqueTokensCommitInterceptor);
tokenRelsLedger.setKeyToString(BackingTokenRels::readableTokenRel);
tokenRelsLedger.setCommitInterceptor(tokenRelsCommitInterceptor);
backingTokens.put(tokenKey.toGrpcTokenId(), fungibleTokenWithTreasury(aModel));
backingTokens.put(anotherTokenKey.toGrpcTokenId(), fungibleTokenWithTreasury(aModel));
backingTokens.put(yetAnotherTokenKey.toGrpcTokenId(), fungibleTokenWithTreasury(aModel));
backingTokens.put(aNftKey.toGrpcTokenId(), nonFungibleTokenWithTreasury(aModel));
backingTokens.put(bNftKey.toGrpcTokenId(), nonFungibleTokenWithTreasury(bModel));
final var sideEffectsTracker = new SideEffectsTracker();
tokenStore = new HederaTokenStore(ids, validator, sideEffectsTracker, dynamicProperties, tokenRelsLedger, nftsLedger, backingTokens);
transferLogic = new TransferLogic(accountsLedger, nftsLedger, tokenRelsLedger, tokenStore, sideEffectsTracker, dynamicProperties, validator, autoCreationLogic, historian);
tokenStore.rebuildViews();
subject = new HederaLedger(tokenStore, ids, creator, validator, sideEffectsTracker, historian, dynamicProperties, accountsLedger, transferLogic, autoCreationLogic);
subject.setMutableEntityAccess(mutableEntityAccess);
subject.setTokenRelsLedger(tokenRelsLedger);
}
use of com.hedera.services.ledger.properties.ChangeSummaryManager in project hedera-services by hashgraph.
the class LedgerImplBackingStoreTest method setUp.
@BeforeEach
void setUp() {
backingTestAccounts = new HashMapTestAccounts();
firstOrder = new TransactionalLedger<>(TestAccountProperty.class, TestAccount::new, backingTestAccounts, new ChangeSummaryManager<>());
}
use of com.hedera.services.ledger.properties.ChangeSummaryManager in project hedera-services by hashgraph.
the class HederaLedgerLiveTest method setup.
@BeforeEach
void setup() {
commonSetup();
accountsLedger = new TransactionalLedger<>(AccountProperty.class, MerkleAccount::new, new HashMapBackingAccounts(), new ChangeSummaryManager<>());
accountsLedger.setCommitInterceptor(accountsCommitInterceptor);
nftsLedger = new TransactionalLedger<>(NftProperty.class, MerkleUniqueToken::new, new HashMapBackingNfts(), new ChangeSummaryManager<>());
nftsLedger.setCommitInterceptor(uniqueTokensCommitInterceptor);
tokenRelsLedger = new TransactionalLedger<>(TokenRelProperty.class, MerkleTokenRelStatus::new, new HashMapBackingTokenRels(), new ChangeSummaryManager<>());
tokenRelsLedger.setKeyToString(BackingTokenRels::readableTokenRel);
tokenRelsLedger.setCommitInterceptor(tokenRelsCommitInterceptor);
tokenStore = new HederaTokenStore(ids, TestContextValidator.TEST_VALIDATOR, liveSideEffects, new MockGlobalDynamicProps(), tokenRelsLedger, nftsLedger, new HashMapBackingTokens());
subject = new HederaLedger(tokenStore, ids, creator, validator, liveSideEffects, historian, dynamicProps, accountsLedger, transferLogic, autoCreationLogic);
subject.setMutableEntityAccess(mock(MutableEntityAccess.class));
}
Aggregations