Skip to content

Commit

Permalink
Change dev network chain ID to 1337 (hyperledger#2162)
Browse files Browse the repository at this point in the history
changed the dev network chain ID to 1337 instead of 2018 so that users can connect to Metamask "localhost 8545" network preset using default chainid settings

Signed-off-by: Manoj Mamidyala <manojmamidyala36@gmail.com>
  • Loading branch information
manojmamidyala authored Apr 29, 2021
1 parent 6543551 commit d2f8b85
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static void setUpOnce() throws Exception {
folder.newFolder().toPath(),
"ethSignerKey--fe3b557e8fb62b89f4916b721be55ceb828dbd73.json",
wireMockRule.port(),
2018);
1337);

ethSignerClient = new EthSignerClient(testHarness.getHttpListeningUrl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
public class PrivacyAcceptanceTestBase {
@ClassRule public static final TemporaryFolder privacy = new TemporaryFolder();

protected static final long POW_CHAIN_ID = 2018;
protected static final long POW_CHAIN_ID = 1337;

protected final PrivacyTransactions privacyTransactions;
protected final PrivateContractVerifier privateContractVerifier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private static PrivateTransaction getValidSignedPrivateTransaction(final Address
.value(Wei.ZERO)
.payload(Bytes.wrap(new byte[] {}))
.sender(senderAddress)
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.privateFrom(Bytes.fromBase64String(PARTICIPANT_ENCLAVE_KEY0))
.restriction(Restriction.RESTRICTED)
.privacyGroupId(Bytes.fromBase64String(PRIVACY_GROUP_ID))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

public class DeployPrivateSmartContractAcceptanceTest extends PrivacyAcceptanceTestBase {

private static final long POW_CHAIN_ID = 2018;
private static final long POW_CHAIN_ID = 1337;

private PrivacyNode minerNode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void setUp() throws Exception {
privacy.newFolder().toPath(),
"ethSignerKey--fe3b557e8fb62b89f4916b721be55ceb828dbd73.json",
minerNode.getBesu().getJsonRpcSocketPort().orElseThrow(),
2018);
1337);

ethSignerClient = new EthSignerClient(ethSigner.getHttpListeningUrl());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class OnChainPrivacyAcceptanceTest extends OnChainPrivacyAcceptanceTestBase {

protected static final long POW_CHAIN_ID = 2018;
protected static final long POW_CHAIN_ID = 1337;

private PrivacyNode alice;
private PrivacyNode bob;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

public class PrivCallAcceptanceTest extends PrivacyAcceptanceTestBase {

private static final long POW_CHAIN_ID = 2018;
private static final long POW_CHAIN_ID = 1337;
private static final int VALUE = 1024;

private PrivacyNode minerNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

public class PrivacyClusterAcceptanceTest extends PrivacyAcceptanceTestBase {

private static final long POW_CHAIN_ID = 2018;
private static final long POW_CHAIN_ID = 1337;

private static final String eventEmitterDeployed =
"0x6080604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fa4f245811461005b5780636057361d1461008257806367e404ce146100ae575b600080fd5b34801561006757600080fd5b506100706100ec565b60408051918252519081900360200190f35b34801561008e57600080fd5b506100ac600480360360208110156100a557600080fd5b50356100f2565b005b3480156100ba57600080fd5b506100c3610151565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60025490565b604080513381526020810183905281517fc9db20adedc6cf2b5d25252b101ab03e124902a73fcb12b753f3d1aaa2d8f9f5929181900390910190a16002556001805473ffffffffffffffffffffffffffffffffffffffff191633179055565b60015473ffffffffffffffffffffffffffffffffffffffff169056fea165627a7a72305820c7f729cb24e05c221f5aa913700793994656f233fe2ce3b9fd9a505ea17e8d8a0029";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.web3j.tx.exceptions.ContractCallException;

public class PrivateContractPublicStateAcceptanceTest extends PrivacyAcceptanceTestBase {
private static final long POW_CHAIN_ID = 2018;
private static final long POW_CHAIN_ID = 1337;

private PrivacyNode minerNode;
private PrivacyNode transactionNode;
Expand Down
4 changes: 2 additions & 2 deletions besu/src/test/java/org/hyperledger/besu/PrivacyReorgTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public class PrivacyReorgTest {
"0x608060405234801561001057600080fd5b5060008054600160a060020a03191633179055610199806100326000396000f3fe6080604052600436106100565763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633fa4f245811461005b5780636057361d1461008257806367e404ce146100ae575b600080fd5b34801561006757600080fd5b506100706100ec565b60408051918252519081900360200190f35b34801561008e57600080fd5b506100ac600480360360208110156100a557600080fd5b50356100f2565b005b3480156100ba57600080fd5b506100c3610151565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b60025490565b604080513381526020810183905281517fc9db20adedc6cf2b5d25252b101ab03e124902a73fcb12b753f3d1aaa2d8f9f5929181900390910190a16002556001805473ffffffffffffffffffffffffffffffffffffffff191633179055565b60015473ffffffffffffffffffffffffffffffffffffffff169056fea165627a7a72305820c7f729cb24e05c221f5aa913700793994656f233fe2ce3b9fd9a505ea17e8d8a0029");
private static final PrivateTransaction PRIVATE_TRANSACTION =
PrivateTransaction.builder()
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.gasLimit(1000)
.gasPrice(Wei.ZERO)
.nonce(0)
Expand Down Expand Up @@ -444,7 +444,7 @@ private SendResponse sendRequest(
private Transaction buildMarkerTransaction(final Bytes payload) {
return Transaction.builder()
.type(TransactionType.FRONTIER)
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.gasLimit(60000)
.gasPrice(Wei.of(1000))
.nonce(0)
Expand Down
2 changes: 1 addition & 1 deletion config/src/main/resources/dev.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"config": {
"chainId": 2018,
"chainId": 1337,
"petersburgBlock": 0,
"contractSizeLimit": 2147483647,
"ethash": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
public class GenesisConfigFileTest {

private static final BigInteger MAINNET_CHAIN_ID = BigInteger.ONE;
private static final BigInteger DEVELOPMENT_CHAIN_ID = BigInteger.valueOf(2018);
private static final BigInteger DEVELOPMENT_CHAIN_ID = BigInteger.valueOf(1337);
private static final GenesisConfigFile EMPTY_CONFIG = fromConfig("{}");

@Test
Expand Down Expand Up @@ -294,7 +294,7 @@ public void testNoOverride() {

assertThat(config.getConfigOptions().getPetersburgBlockNumber()).hasValue(0);
assertThat(config.getConfigOptions().getIstanbulBlockNumber()).isNotPresent();
assertThat(config.getConfigOptions().getChainId()).hasValue(BigInteger.valueOf(2018));
assertThat(config.getConfigOptions().getChainId()).hasValue(BigInteger.valueOf(1337));
assertThat(config.getConfigOptions().getContractSizeLimit()).hasValue(2147483647);
assertThat(config.getConfigOptions().getEvmStackSize()).isNotPresent();
assertThat(config.getConfigOptions().getEcip1017EraRounds()).isNotPresent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class PrivateTransactionDataFixture {
public static final Wei DEFAULT_VALUE = Wei.of(0);
public static final Address DEFAULT_SENDER =
Address.fromHexString("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73");
public static final BigInteger DEFAULT_CHAIN_ID = BigInteger.valueOf(2018);
public static final BigInteger DEFAULT_CHAIN_ID = BigInteger.valueOf(1337);

public static final Supplier<SignatureAlgorithm> SIGNATURE_ALGORITHM =
Suppliers.memoize(SignatureAlgorithmFactory::getInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class TransactionTestFixture {

private Bytes payload = Bytes.EMPTY;

private Optional<BigInteger> chainId = Optional.of(BigInteger.valueOf(2018));
private Optional<BigInteger> chainId = Optional.of(BigInteger.valueOf(1337));

private Optional<Wei> gasPremium = Optional.empty();
private Optional<Wei> feeCap = Optional.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public class DefaultPrivacyControllerTest {
.value(Wei.ZERO)
.payload(Base64.decode(TRANSACTION_KEY))
.sender(Address.fromHexString("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"))
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.signAndBuild(KEY_PAIR);

private Enclave mockEnclave() {
Expand Down Expand Up @@ -528,7 +528,7 @@ private static PrivateTransaction.Builder buildPrivateTransaction(final long non
.value(Wei.ZERO)
.payload(Bytes.fromHexString("0x"))
.sender(Address.fromHexString("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"))
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.restriction(Restriction.RESTRICTED);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public void testBuildInvalidPrivateTransactionThrowsException() {
.value(Wei.ZERO)
.payload(Bytes.fromHexString("0x"))
.sender(Address.fromHexString("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"))
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.privacyGroupId(Bytes.fromBase64String("DyAOiF/ynpc+JXa2YAGB0bCitSlOMNm+ShmB/7M6C4w="))
.privateFrom(Bytes.fromBase64String("A1aVtMxLCUHmBVHXoZzzBgPbW/wj5axDpW9X8l91SGo="))
.privateFor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ private Transaction publicTransaction() {
.value(Wei.ZERO)
.payload(Bytes.EMPTY)
.sender(Address.fromHexString("0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"))
.chainId(BigInteger.valueOf(2018))
.chainId(BigInteger.valueOf(1337))
.signAndBuild(SignatureAlgorithmFactory.getInstance().generateKeyPair());
}
}

0 comments on commit d2f8b85

Please sign in to comment.