use of com.hedera.services.legacy.core.jproto.JContractIDKey in project hedera-services by hashgraph.
the class FeeSchedulesManagerTest method setup.
@BeforeEach
private void setup() {
attr = new HFileMeta(false, new JContractIDKey(1, 2, 3), Instant.now().getEpochSecond());
fees = mock(FeeCalculator.class);
subject = new FeeSchedulesManager(new MockFileNumbers(), fees);
}
use of com.hedera.services.legacy.core.jproto.JContractIDKey in project hedera-services by hashgraph.
the class PlatformSigOpsTest method setup.
@BeforeEach
void setup() throws Throwable {
pubKeys.clear();
sigBytes = mock(PubKeyToSigBytes.class);
sigFactory = mock(TxnScopedPlatformSigFactory.class);
for (final var kt : kts) {
pubKeys.add(kt.asJKey());
}
pubKeys.add(new JContractIDKey(0, 0, 1234));
pubKeys.add(new JDelegatableContractIDKey(0, 0, 12345));
}
use of com.hedera.services.legacy.core.jproto.JContractIDKey in project hedera-services by hashgraph.
the class UpdateCustomizerFactory method processAdminKey.
private boolean processAdminKey(final ContractUpdateTransactionBody updateOp, final ContractID cid, final HederaAccountCustomizer customizer) {
if (IMMUTABILITY_SENTINEL_KEY.equals(updateOp.getAdminKey())) {
customizer.key(new JContractIDKey(cid.getShardNum(), cid.getRealmNum(), cid.getContractNum()));
} else {
var resolution = keyIfAcceptable(updateOp.getAdminKey());
if (resolution.isEmpty()) {
// return Pair.of(Optional.empty(), INVALID_ADMIN_KEY);
return true;
}
customizer.key(resolution.get());
}
return false;
}
use of com.hedera.services.legacy.core.jproto.JContractIDKey in project hedera-services by hashgraph.
the class TxnAwareRatesManagerTest method setup.
@BeforeEach
private void setup() {
attr = new HFileMeta(false, new JContractIDKey(1, 2, 3), Instant.now().getEpochSecond());
PlatformTxnAccessor accessor = mock(PlatformTxnAccessor.class);
given(accessor.getSignedTxnWrapper()).willReturn(Transaction.getDefaultInstance());
txnCtx = mock(TransactionContext.class);
given(txnCtx.accessor()).willReturn(accessor);
midnightRates = mock(ExchangeRates.class);
postUpdateCb = mock(Consumer.class);
intradayLimit = mock(BiPredicate.class);
intradayLimitFactory = mock(IntFunction.class);
given(intradayLimitFactory.apply(actualLimit)).willReturn(intradayLimit);
properties = mock(GlobalDynamicProperties.class);
given(properties.ratesIntradayChangeLimitPercent()).willReturn(actualLimit);
subject = new TxnAwareRatesManager(new MockFileNumbers(), new MockAccountNumbers(), properties, txnCtx, () -> midnightRates, postUpdateCb, intradayLimitFactory);
}
use of com.hedera.services.legacy.core.jproto.JContractIDKey in project hedera-services by hashgraph.
the class ValidatingCallbackInterceptorTest method setup.
@BeforeEach
private void setup() {
attr = new HFileMeta(false, new JContractIDKey(1, 2, 3), Instant.now().getEpochSecond());
validator = mock(Predicate.class);
postUpdateCb = mock(Consumer.class);
properties = mock(PropertySource.class);
given(properties.getLongProperty(numProperty)).willReturn(actualNum);
subject = new ValidatingCallbackInterceptor(applicablePriority, numProperty, properties, postUpdateCb, validator);
}
Aggregations