Create new datatypes module for Address, Hash, and Wei (#2779)

* Create new datatypes module

Create a new `datatypes` module to hold datatypes that are broadly used.
This will aid modularization by making sure the base types in the module
minimize the amount of unrelated support classes needed.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>

* Add Address, Hash, and Wei to datatypes

Move the Address, Hash, and Wei to datatypes in as they are needed for
EVM modularization.

Signed-off-by: Danno Ferrin <danno.ferrin@gmail.com>
This commit is contained in:
Danno Ferrin
2021-09-20 14:08:09 -06:00
committed by GitHub
parent 181d566f9a
commit 2abc7074bb
949 changed files with 1438 additions and 1280 deletions

View File

@@ -1,10 +1,11 @@
dependencies {
implementation project(':plugin-api')
implementation project(':besu')
implementation project(':ethereum:core')
implementation project(':crypto')
implementation project(':datatypes')
implementation project(':ethereum:core')
implementation project(':ethereum:rlp')
implementation project(':plugin-api')
implementation 'com.google.auto.service:auto-service'
implementation 'info.picocli:picocli'
implementation 'org.apache.logging.log4j:log4j-api'

View File

@@ -15,7 +15,7 @@
*/
package org.hyperledger.besu.plugins.privacy;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.plugin.data.Address;
import org.hyperledger.besu.plugin.data.PrivacyGenesis;
import org.hyperledger.besu.plugin.data.PrivacyGenesisAccount;
@@ -45,7 +45,7 @@ public class TestPrivacyGroupGenesisProvider implements PrivacyGroupGenesisProvi
new PrivacyGenesisAccount() {
@Override
public Address getAddress() {
return org.hyperledger.besu.ethereum.core.Address.fromHexString(
return org.hyperledger.besu.datatypes.Address.fromHexString(
"0x1000000000000000000000000000000000000001");
}

View File

@@ -15,15 +15,15 @@
package org.hyperledger.besu.plugins.privacy;
import static org.apache.logging.log4j.LogManager.getLogger;
import static org.hyperledger.besu.ethereum.core.Address.extract;
import static org.hyperledger.besu.datatypes.Address.extract;
import org.hyperledger.besu.crypto.KeyPair;
import org.hyperledger.besu.crypto.SECPPrivateKey;
import org.hyperledger.besu.crypto.SignatureAlgorithm;
import org.hyperledger.besu.crypto.SignatureAlgorithmFactory;
import org.hyperledger.besu.ethereum.core.Hash;
import org.hyperledger.besu.datatypes.Hash;
import org.hyperledger.besu.datatypes.Wei;
import org.hyperledger.besu.ethereum.core.Transaction;
import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput;
import org.hyperledger.besu.plugin.data.Address;
import org.hyperledger.besu.plugin.data.PrivateTransaction;
@@ -65,7 +65,7 @@ public class TestSigningPrivateMarkerTransactionFactory implements PrivateMarker
unsignedPrivateMarkerTransaction.getGasPrice().map(Wei::fromQuantity).orElse(null))
.gasLimit(unsignedPrivateMarkerTransaction.getGasLimit())
.to(
org.hyperledger.besu.ethereum.core.Address.fromPlugin(
org.hyperledger.besu.datatypes.Address.fromPlugin(
unsignedPrivateMarkerTransaction.getTo().get()))
.value(Wei.fromQuantity(unsignedPrivateMarkerTransaction.getValue()))
.payload(unsignedPrivateMarkerTransaction.getPayload())