Standardize pubkey and public key naming in deposit (#6012)

---------

Signed-off-by: naviechan <adrninistrator1@protonmail.com>
Signed-off-by: Navie Chan <naviechan@gmail.com>
Signed-off-by: Simon Dudley <simon.dudley@consensys.net>
pull/6035/head
NC 1 year ago committed by GitHub
parent c88820ffa8
commit 5fce4fd3ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/parameters/DepositParameter.java
  2. 16
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/Deposit.java
  3. 2
      ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/DepositEncoder.java
  4. 2
      plugin-api/build.gradle
  5. 2
      plugin-api/src/main/java/org/hyperledger/besu/plugin/data/Deposit.java

@ -30,7 +30,7 @@ import org.apache.tuweni.units.bigints.UInt64;
public class DepositParameter {
private final String publicKey;
private final String pubkey;
private final String withdrawalCredentials;
private final String amount;
@ -40,12 +40,12 @@ public class DepositParameter {
@JsonCreator
public DepositParameter(
@JsonProperty("pubkey") final String pubKey,
@JsonProperty("pubkey") final String pubkey,
@JsonProperty("withdrawalCredentials") final String withdrawalCredentials,
@JsonProperty("amount") final String amount,
@JsonProperty("signature") final String signature,
@JsonProperty("index") final String index) {
this.publicKey = pubKey;
this.pubkey = pubkey;
this.withdrawalCredentials = withdrawalCredentials;
this.amount = amount;
this.signature = signature;
@ -54,7 +54,7 @@ public class DepositParameter {
public static DepositParameter fromDeposit(final Deposit deposit) {
return new DepositParameter(
deposit.getPublicKey().toString(),
deposit.getPubkey().toString(),
deposit.getWithdrawalCredentials().toString(),
deposit.getAmount().toShortHexString(),
deposit.getSignature().toString(),
@ -63,7 +63,7 @@ public class DepositParameter {
public Deposit toDeposit() {
return new Deposit(
BLSPublicKey.fromHexString(publicKey),
BLSPublicKey.fromHexString(pubkey),
Bytes32.fromHexString(withdrawalCredentials),
GWei.fromHexString(amount),
BLSSignature.fromHexString(signature),
@ -72,7 +72,7 @@ public class DepositParameter {
public JsonObject asJsonObject() {
return new JsonObject()
.put("pubKey", publicKey)
.put("pubkey", pubkey)
.put("withdrawalCredentials", withdrawalCredentials)
.put("amount", amount)
.put("signature", signature)
@ -80,8 +80,8 @@ public class DepositParameter {
}
@JsonGetter
public String getPublicKey() {
return publicKey;
public String getPubkey() {
return pubkey;
}
@JsonGetter
@ -109,7 +109,7 @@ public class DepositParameter {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final DepositParameter that = (DepositParameter) o;
return Objects.equals(publicKey, that.publicKey)
return Objects.equals(pubkey, that.pubkey)
&& Objects.equals(withdrawalCredentials, that.withdrawalCredentials)
&& Objects.equals(amount, that.amount)
&& Objects.equals(signature, that.signature)
@ -118,14 +118,14 @@ public class DepositParameter {
@Override
public int hashCode() {
return Objects.hash(publicKey, withdrawalCredentials, amount, signature, index);
return Objects.hash(pubkey, withdrawalCredentials, amount, signature, index);
}
@Override
public String toString() {
return "DepositParameter{"
+ "pubKey='"
+ publicKey
+ pubkey
+ '\''
+ ", withdrawalCredentials='"
+ withdrawalCredentials

@ -32,19 +32,19 @@ import org.apache.tuweni.units.bigints.UInt64;
public class Deposit implements org.hyperledger.besu.plugin.data.Deposit {
private final BLSPublicKey pubKey;
private final BLSPublicKey pubkey;
private final Bytes32 depositWithdrawalCredentials;
private final GWei amount;
private final BLSSignature signature;
private final UInt64 index;
public Deposit(
final BLSPublicKey pubKey,
final BLSPublicKey pubkey,
final Bytes32 depositWithdrawalCredentials,
final GWei amount,
final BLSSignature signature,
final UInt64 index) {
this.pubKey = pubKey;
this.pubkey = pubkey;
this.depositWithdrawalCredentials = depositWithdrawalCredentials;
this.amount = amount;
this.signature = signature;
@ -64,8 +64,8 @@ public class Deposit implements org.hyperledger.besu.plugin.data.Deposit {
}
@Override
public PublicKey getPublicKey() {
return pubKey;
public PublicKey getPubkey() {
return pubkey;
}
@Override
@ -92,7 +92,7 @@ public class Deposit implements org.hyperledger.besu.plugin.data.Deposit {
public String toString() {
return "Deposit{"
+ "pubKey="
+ pubKey
+ pubkey
+ ", withdrawalCredentials="
+ depositWithdrawalCredentials
+ ", amount="
@ -109,7 +109,7 @@ public class Deposit implements org.hyperledger.besu.plugin.data.Deposit {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final Deposit that = (Deposit) o;
return Objects.equals(pubKey, that.pubKey)
return Objects.equals(pubkey, that.pubkey)
&& Objects.equals(depositWithdrawalCredentials, that.depositWithdrawalCredentials)
&& Objects.equals(amount, that.amount)
&& Objects.equals(signature, that.signature)
@ -118,6 +118,6 @@ public class Deposit implements org.hyperledger.besu.plugin.data.Deposit {
@Override
public int hashCode() {
return Objects.hash(pubKey, depositWithdrawalCredentials, amount, signature, index);
return Objects.hash(pubkey, depositWithdrawalCredentials, amount, signature, index);
}
}

@ -24,7 +24,7 @@ public class DepositEncoder {
public static void encode(final Deposit deposit, final RLPOutput rlpOutput) {
rlpOutput.startList();
rlpOutput.writeBytes(deposit.getPublicKey());
rlpOutput.writeBytes(deposit.getPubkey());
rlpOutput.writeBytes(deposit.getWithdrawalCredentials());
rlpOutput.writeUInt64Scalar(deposit.getAmount());
rlpOutput.writeBytes(deposit.getSignature());

@ -69,7 +69,7 @@ Calculated : ${currentHash}
tasks.register('checkAPIChanges', FileStateChecker) {
description = "Checks that the API for the Plugin-API project does not change without deliberate thought"
files = sourceSets.main.allJava.files
knownHash = '5koUOxNHaYeuIFYH2PP/6RdMO1JvCm0ILdl/DyY297Y='
knownHash = 'j6NRklFHlG35Pq/t6t/oJBrT8DbYOyruGq3cJNh4ENw='
}
check.dependsOn('checkAPIChanges')

@ -34,7 +34,7 @@ public interface Deposit {
*
* @return public key of sender
*/
PublicKey getPublicKey();
PublicKey getPubkey();
/**
* Withdrawal credential that contains info that will be used for verifying the destination of

Loading…
Cancel
Save