Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: remove swirlds-commons dependency from swirlds-config-impl #10386

Merged
merged 3 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.hedera.node.app.hapi.utils.throttles;

import static com.hedera.node.app.hapi.utils.CommonUtils.productWouldOverflow;
import static com.swirlds.common.units.UnitConstants.SECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.SECONDS_TO_NANOSECONDS;

/**
* Responsible for throttling transaction by gas limit. Uses a {@link DiscreteLeakyBucket} under the
Expand Down
1 change: 1 addition & 0 deletions hedera-node/hapi-utils/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
requires com.fasterxml.jackson.databind;
requires com.google.common;
requires com.sun.jna;
requires com.swirlds.base;
requires org.apache.commons.codec;
requires org.apache.logging.log4j.core;
requires org.apache.logging.log4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.hedera.node.app.hapi.utils.throttles;

import static com.swirlds.common.units.UnitConstants.SECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.SECONDS_TO_NANOSECONDS;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.hedera.node.app.service.mono.records;

import static com.hedera.node.app.service.mono.stream.RecordStreamManager.effectiveLogDir;
import static com.swirlds.common.units.UnitConstants.SECONDS_TO_MILLISECONDS;
import static com.swirlds.base.units.UnitConstants.SECONDS_TO_MILLISECONDS;

import com.google.common.cache.Cache;
import com.hedera.node.app.service.mono.context.annotations.StaticAccountMemo;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import static com.hedera.node.app.service.mono.context.properties.PropertyNames.HEDERA_RECORD_STREAM_LOG_EVERY_TRANSACTION;
import static com.hedera.node.app.service.mono.context.properties.PropertyNames.HEDERA_RECORD_STREAM_LOG_PERIOD;
import static com.hedera.node.app.service.mono.state.merkle.MerkleNetworkContext.ethHashFrom;
import static com.swirlds.base.units.UnitConstants.SECONDS_TO_MILLISECONDS;
import static com.swirlds.common.stream.LinkedObjectStreamUtilities.getPeriod;
import static com.swirlds.common.units.UnitConstants.SECONDS_TO_MILLISECONDS;

import com.hedera.node.app.service.evm.contracts.execution.HederaBlockValues;
import com.hedera.node.app.service.mono.context.properties.BootstrapProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.hedera.node.app.service.mono.stream;

import static com.swirlds.base.units.UnitConstants.MB_TO_BYTES;
import static com.swirlds.common.threading.manager.AdHocThreadManager.getStaticThreadManager;
import static com.swirlds.common.units.UnitConstants.MB_TO_BYTES;

import com.google.common.annotations.VisibleForTesting;
import com.hedera.node.app.service.mono.context.properties.GlobalDynamicProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
package com.hedera.node.app.service.mono.stream;

import static com.hedera.node.app.hapi.utils.exports.FileCompressionUtils.COMPRESSION_ALGORITHM_EXTENSION;
import static com.swirlds.base.units.UnitConstants.MB_TO_BYTES;
import static com.swirlds.common.crypto.SignatureType.RSA;
import static com.swirlds.common.stream.LinkedObjectStreamUtilities.generateStreamFileNameFromInstant;
import static com.swirlds.common.stream.StreamAligned.NO_ALIGNMENT;
import static com.swirlds.common.units.UnitConstants.MB_TO_BYTES;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.hedera.node.app.service.mono.stream;

import static com.swirlds.common.units.UnitConstants.MB_TO_BYTES;
import static com.swirlds.base.units.UnitConstants.MB_TO_BYTES;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import static com.hedera.node.app.service.contract.impl.exec.utils.FrameUtils.configOf;
import static com.hedera.node.app.service.contract.impl.exec.utils.FrameUtils.tinybarValuesFor;
import static com.swirlds.common.units.UnitConstants.HOURS_TO_MINUTES;
import static com.swirlds.common.units.UnitConstants.MINUTES_TO_SECONDS;
import static com.swirlds.base.units.UnitConstants.HOURS_TO_MINUTES;
import static com.swirlds.base.units.UnitConstants.MINUTES_TO_SECONDS;
import static java.util.Objects.requireNonNull;

import com.hedera.node.config.data.CacheConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
requires com.hedera.node.app.service.evm;
requires com.github.benmanes.caffeine;
requires com.google.common;
requires com.swirlds.base;
requires com.swirlds.common;
requires org.bouncycastle.provider;
requires static com.github.spotbugs.annotations;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/

import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.common.metrics.Metric.ValueType.VALUE;
import static com.swirlds.common.threading.manager.AdHocThreadManager.getStaticThreadManager;
import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.platform.gui.SwirldsGui.createConsole;

import com.swirlds.common.Console;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module com.swirlds.demo.stats {
requires com.swirlds.base;
requires com.swirlds.common;
requires com.swirlds.platform.core;
requires java.desktop;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.demo.migration;

import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_SECONDS;

import com.swirlds.common.platform.NodeId;
import com.swirlds.fcqueue.FCQueueStatistics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.demo.merkle.map;

import static com.swirlds.common.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.demo.merkle.map.FCMTransactionPool.DEMO_TRANSACTION_INFO;
import static com.swirlds.merkle.map.test.lifecycle.TransactionState.HANDLED;
import static com.swirlds.merkle.map.test.lifecycle.TransactionType.Create;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.swirlds.base.units.UnitConstants;
import com.swirlds.base.utility.Pair;
import com.swirlds.common.merkle.iterators.MerkleIterator;
import com.swirlds.common.metrics.Counter;
Expand All @@ -48,7 +49,6 @@
import com.swirlds.common.metrics.SpeedometerMetric;
import com.swirlds.common.platform.NodeId;
import com.swirlds.common.threading.framework.config.ThreadConfiguration;
import com.swirlds.common.units.UnitConstants;
import com.swirlds.common.utility.AutoCloseableWrapper;
import com.swirlds.common.utility.StopWatch;
import com.swirlds.demo.merkle.map.FCMConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.swirlds.demo.platform;

import static com.swirlds.base.units.UnitConstants.MICROSECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_MICROSECONDS;
import static com.swirlds.common.io.streams.SerializableStreamConstants.NULL_CLASS_ID;
import static com.swirlds.common.metrics.FloatFormats.FORMAT_11_0;
import static com.swirlds.common.units.UnitConstants.MICROSECONDS_TO_NANOSECONDS;
import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_MICROSECONDS;
import static com.swirlds.common.utility.CommonUtils.hex;
import static com.swirlds.demo.platform.fs.stresstest.proto.TestTransaction.BodyCase.FCMTRANSACTION;
import static com.swirlds.logging.legacy.LogMarker.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package com.swirlds.demo.platform;

import static com.swirlds.base.units.UnitConstants.SECONDS_TO_MILLISECONDS;
import static com.swirlds.common.metrics.Metrics.PLATFORM_CATEGORY;
import static com.swirlds.common.units.UnitConstants.SECONDS_TO_MILLISECONDS;

import com.swirlds.base.utility.Pair;
import com.swirlds.common.metrics.Metrics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.demo.platform.expiration;

import static com.swirlds.common.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;

import com.swirlds.common.platform.NodeId;
import com.swirlds.demo.merkle.map.FCMFamily;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/

import static com.swirlds.base.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_MICROSECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.common.threading.manager.AdHocThreadManager.getStaticThreadManager;
import static com.swirlds.common.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_MICROSECONDS;
import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.logging.legacy.LogMarker.STARTUP;

import com.swirlds.common.metrics.Metrics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module com.swirlds.demo.stats.signing {
requires com.swirlds.base;
requires com.swirlds.common;
requires com.swirlds.logging;
requires com.swirlds.platform.core;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/

import static com.swirlds.base.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_MICROSECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.common.threading.manager.AdHocThreadManager.getStaticThreadManager;
import static com.swirlds.common.units.UnitConstants.MILLISECONDS_TO_NANOSECONDS;
import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_MICROSECONDS;
import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.logging.legacy.LogMarker.STARTUP;

import com.swirlds.common.metrics.Metrics;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module com.swirlds.demo.stress {
requires com.swirlds.base;
requires com.swirlds.common;
requires com.swirlds.config.api;
requires com.swirlds.logging;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.swirlds.common.units;
package com.swirlds.base.units;

/**
* Contains a variety constants useful when converting between units.
Expand Down
1 change: 1 addition & 0 deletions platform-sdk/swirlds-base/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports com.swirlds.base.function;
exports com.swirlds.base.state;
exports com.swirlds.base.time;
exports com.swirlds.base.units;
exports com.swirlds.base.utility;
exports com.swirlds.base.context;
exports com.swirlds.base.context.internal to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.base.test.fixtures.time;

import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_MILLISECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_MILLISECONDS;

import com.swirlds.base.time.Time;
import java.time.Duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
requires transitive com.swirlds.base;
requires transitive org.junit.jupiter.api;
requires static com.github.spotbugs.annotations;
requires com.swirlds.common; // Should be removed in future
requires jakarta.inject;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.swirlds.common.bloom;

import static com.swirlds.common.units.UnitConstants.BITS_TO_BYTES;
import static com.swirlds.common.units.UnitConstants.BYTES_PER_INT;
import static com.swirlds.common.units.UnitConstants.BYTES_TO_BITS;
import static com.swirlds.base.units.UnitConstants.BITS_TO_BYTES;
import static com.swirlds.base.units.UnitConstants.BYTES_PER_INT;
import static com.swirlds.base.units.UnitConstants.BYTES_TO_BITS;

import com.swirlds.common.io.SelfSerializable;
import com.swirlds.common.io.streams.SerializableDataInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.common.bloom.hasher;

import static com.swirlds.common.units.UnitConstants.BYTES_PER_LONG;
import static com.swirlds.base.units.UnitConstants.BYTES_PER_LONG;
import static com.swirlds.common.utility.ByteUtils.byteArrayToLong;
import static com.swirlds.common.utility.NonCryptographicHashing.hash64;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.swirlds.common.io.extendable.extensions;

import com.swirlds.base.units.UnitConstants;
import com.swirlds.common.io.extendable.extensions.internal.Counter;
import com.swirlds.common.io.extendable.extensions.internal.StandardCounter;
import com.swirlds.common.io.extendable.extensions.internal.ThreadSafeCounter;
import com.swirlds.common.units.UnitConstants;

/**
* A stream extension that counts the number of bytes that pass through it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.common.io.extendable.extensions;

import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.common.utility.CompareTo.isGreaterThanOrEqualTo;
import static java.util.concurrent.TimeUnit.MILLISECONDS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.common.merkle.synchronization;

import static com.swirlds.common.units.UnitConstants.MILLISECONDS_TO_SECONDS;
import static com.swirlds.base.units.UnitConstants.MILLISECONDS_TO_SECONDS;
import static com.swirlds.logging.legacy.LogMarker.EXCEPTION;
import static com.swirlds.logging.legacy.LogMarker.RECONNECT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import static com.swirlds.common.metrics.Metric.ValueType.VALUE;

import com.swirlds.base.ArgumentUtils;
import com.swirlds.common.units.UnitConstants;
import com.swirlds.base.units.UnitConstants;
import edu.umd.cs.findbugs.annotations.NonNull;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import static com.swirlds.common.utility.CommonUtils.throwArgBlank;

import com.swirlds.base.time.Time;
import com.swirlds.base.units.UnitConstants;
import com.swirlds.common.metrics.IntegerAccumulator;
import com.swirlds.common.metrics.IntegerPairAccumulator;
import com.swirlds.common.metrics.LongAccumulator;
import com.swirlds.common.metrics.Metric;
import com.swirlds.common.metrics.Metrics;
import com.swirlds.common.time.IntegerEpochTime;
import com.swirlds.common.units.UnitConstants;
import java.util.Objects;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.swirlds.common.metrics.statistics.internal;

import static com.swirlds.common.units.UnitConstants.NANOSECONDS_TO_SECONDS;
import static com.swirlds.base.units.UnitConstants.NANOSECONDS_TO_SECONDS;

import com.swirlds.base.time.Time;
import java.util.concurrent.atomic.AtomicInteger;
Expand Down
Loading
Loading