Skip to content

Commit

Permalink
Fix name of parameter for WithdrawalRequest (#7122)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Saldanha <[email protected]>
  • Loading branch information
lucassaldanha authored May 19, 2024
1 parent c90f18c commit d7123ce
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
"sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb",
"amount" : "0x0",
"validatorPubKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"
"validatorPublicKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"
}
],
"blockNumber": "0x2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{
"sourceAddress": "0xa4664c40aacebd82a2db79f0ea36c06bc6a19adb",
"amount" : "0x0",
"validatorPubKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"
"validatorPublicKey": "0xb10a4a15bf67b328c9b101d09e5c6ee6672978fdad9ef0d9e2ceffaee99223555d8601f0cb3bcc4ce1af9864779a416e"
}
],
"blockNumber": "0x2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{
"sourceAddress": "0x23618e81e3f5cdf7f54c3d65f7fbc0abf5b21e8f",
"amount": "0x0",
"validatorPubKey": "0x8706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243"
"validatorPublicKey": "0x8706d19a62f28a6a6549f96c5adaebac9124a61d44868ec94f6d2d707c6a2f82c9162071231dfeb40e24bfde4ffdf243"
}
],
"blockNumber": "0x4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,20 @@
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.vertx.core.json.JsonObject;

public class WithdrawalRequestParameter {

private final String sourceAddress;
private final String validatorPubKey;
private final String validatorPublicKey;
private final String amount;

@JsonCreator
public WithdrawalRequestParameter(
@JsonProperty("sourceAddress") final String sourceAddress,
@JsonProperty("validatorPublicKey") final String validatorPubKey,
@JsonProperty("validatorPublicKey") final String validatorPublicKey,
@JsonProperty("amount") final String amount) {
this.sourceAddress = sourceAddress;
this.validatorPubKey = validatorPubKey;
this.validatorPublicKey = validatorPublicKey;
this.amount = amount;
}

Expand All @@ -53,25 +52,18 @@ public static WithdrawalRequestParameter fromWithdrawalRequest(
public WithdrawalRequest toWithdrawalRequest() {
return new WithdrawalRequest(
Address.fromHexString(sourceAddress),
BLSPublicKey.fromHexString(validatorPubKey),
BLSPublicKey.fromHexString(validatorPublicKey),
GWei.fromHexString(amount));
}

public JsonObject asJsonObject() {
return new JsonObject()
.put("sourceAddress", sourceAddress)
.put("validatorPubKey", validatorPubKey)
.put("amount", amount);
}

@JsonGetter
public String getSourceAddress() {
return sourceAddress;
}

@JsonGetter
public String getValidatorPubKey() {
return validatorPubKey;
public String getValidatorPublicKey() {
return validatorPublicKey;
}

@JsonGetter
Expand All @@ -85,13 +77,13 @@ public boolean equals(final Object o) {
if (o == null || getClass() != o.getClass()) return false;
final WithdrawalRequestParameter that = (WithdrawalRequestParameter) o;
return Objects.equals(sourceAddress, that.sourceAddress)
&& Objects.equals(validatorPubKey, that.validatorPubKey)
&& Objects.equals(validatorPublicKey, that.validatorPublicKey)
&& Objects.equals(amount, that.amount);
}

@Override
public int hashCode() {
return Objects.hash(sourceAddress, validatorPubKey, amount);
return Objects.hash(sourceAddress, validatorPublicKey, amount);
}

@Override
Expand All @@ -101,7 +93,7 @@ public String toString() {
+ sourceAddress
+ '\''
+ ", validatorPubKey='"
+ validatorPubKey
+ validatorPublicKey
+ '\''
+ ", amount='"
+ amount
Expand Down

0 comments on commit d7123ce

Please sign in to comment.