Skip to content

Commit

Permalink
Fix some typos & a few other things (#632)
Browse files Browse the repository at this point in the history
* Remove added newline (thanks vim)
* Fix a double word typo
  • Loading branch information
jtraglia authored Sep 4, 2022
1 parent 8656664 commit b20bd47
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ backward compatibility with PHASE0 blocks.
### Features Added
- Separate application into eth2, eth and Filecoin commands that can be run independently
- Eth2 slashing protection. Requires a PostgreSQL database to store eth2 signed blocks and attestations
- Ethereuem secp256k1 signing of data
- Ethereum secp256k1 signing of data
- Use yaml configuration of signing keys
- Support for Filecoin JSON RPCs
- Azure secret vault support for eth2 keys to load all secrets from a given vault
Expand Down
2 changes: 1 addition & 1 deletion CODING-CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Web3Signer follows the [Google code style](https://google.github.io/styleguide/j

To automatically reformat the code before creating a pull request, run:

```json
```
./gradlew spotlessApply
```

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Provide the following information:
* **Use a clear and descriptive title** for the issue to identify the suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
* **Provide specific examples to demonstrate the steps**. If you're providing code snippets in the issue,
use backticks (````) to format the code snippets..
use backticks (````) to format the code snippets.
* **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
* **Include screenshots** which help you demonstrate the steps where possible.
* **Explain why this enhancement would be useful** to most users.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private String createEth2SlashingProtectionArgs() {
yamlConfig.append(
String.format(
YAML_NUMERIC_FMT,
"eth2.sslashing-protection-pruning-slots-per-epoch",
"eth2.slashing-protection-pruning-slots-per-epoch",
signerConfig.getSlashingProtectionPruningSlotsPerEpoch()));
yamlConfig.append(
String.format(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ void compareWalletListResponses() {
}

@RepeatedTest(25)
@Test
void compareWalletSignAndVerifyResponsesWithRandomDataToSign() {

addressMap.keySet().parallelStream()
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ gradle.startParameter.taskNames.each {
}
gradle.startParameter.taskNames = expandedTaskList.flatten()

// Gets a integer command argument, passed with -Pname=x, or the defaut if not provided.
// Gets a integer command argument, passed with -Pname=x, or the default if not provided.
def _intCmdArg(name, defaultValue) {
return project.hasProperty(name) ? project.property(name) as int : defaultValue
}
Expand Down Expand Up @@ -188,7 +188,7 @@ allprojects {
check('ImmutableEnumChecker', CheckSeverity.OFF)
// This is a style check instead of an error-prone pattern.
check('UnnecessaryParentheses', CheckSeverity.OFF)
// Lazy impl causes excess CPU usage O(n) of non-final fiield when it should be O(1).
// Lazy impl causes excess CPU usage O(n) of non-final field when it should be O(1).
check('FieldCanBeFinal', CheckSeverity.OFF)
// Incorrectly fires when there are no java.time.* alternatives
check('PreferJavaTimeOverload', CheckSeverity.OFF)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public UInt64 deserialize(final JsonParser p, final DeserializationContext ctxt)
try {
return UInt64.valueOf(p.getBigIntegerValue());
} catch (final Exception e) {
throw new RuntimeException("Failed to parse integer as as UInt64", e);
throw new RuntimeException("Failed to parse integer as a UInt64", e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,14 @@ private Bytes computeSigningRoot(final Eth2SigningRequestBody body) {
return DepositSigningRootUtil.compute_signing_root(
body.getDeposit().asInternalDepositMessage(), depositDomain);
case SYNC_COMMITTEE_MESSAGE:
final SyncCommitteeMessage syncCommitteMessage = body.getSyncCommitteeMessage();
checkArgument(syncCommitteMessage != null, "SyncCommitteeMessage must be specified");
final SyncCommitteeMessage syncCommitteeMessage = body.getSyncCommitteeMessage();
checkArgument(syncCommitteeMessage != null, "SyncCommitteeMessage must be specified");
return signingRootFromSyncCommitteeUtils(
syncCommitteMessage.getSlot(),
syncCommitteeMessage.getSlot(),
utils ->
utils.getSyncCommitteeMessageSigningRoot(
syncCommitteMessage.getBeaconBlockRoot(),
eth2Spec.computeEpochAtSlot(syncCommitteMessage.getSlot()),
syncCommitteeMessage.getBeaconBlockRoot(),
eth2Spec.computeEpochAtSlot(syncCommitteeMessage.getSlot()),
body.getForkInfo().asInternalForkInfo()));
case SYNC_COMMITTEE_SELECTION_PROOF:
final SyncAggregatorSelectionData syncAggregatorSelectionData =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void cleanup() {
}

@Test
void signerReturnedForMatchingIdentifer() {
void signerReturnedForMatchingIdentifier() {
final ArtifactSigner mockSigner = mock(ArtifactSigner.class);
when(mockSigner.getIdentifier()).thenReturn(PUBLIC_KEY1);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private void validateAttestations(
slashingProtectionContext
.getSlashingProtection()
.maySignAttestation(
attestation.getPublickKey(),
attestation.getPublicKey(),
attestation.getSigningRoot(),
attestation.getSourceEpoch(),
attestation.getTargetEpoch(),
Expand All @@ -200,7 +200,7 @@ private void validateAttestations(
LOG.warn(
"Detected a valid signing condition which was rejected by slashing-protection (attestation {} for validator {})",
i,
attestation.getPublickKey());
attestation.getPublicKey());
}
}
}
Expand All @@ -212,7 +212,7 @@ private void validateBlocks(final List<BlockTestModel> blocks, final Bytes32 gvr
final boolean result =
slashingProtectionContext
.getSlashingProtection()
.maySignBlock(block.getPublickKey(), block.getSigningRoot(), block.getSlot(), gvr);
.maySignBlock(block.getPublicKey(), block.getSigningRoot(), block.getSlot(), gvr);
// NOTE: Ref tests are only fail if you sign something which is flagged as "!should_Succeed".
// (i.e. a "reject" response is always correct)
if (!block.isShouldSucceed()) {
Expand All @@ -221,7 +221,7 @@ private void validateBlocks(final List<BlockTestModel> blocks, final Bytes32 gvr
LOG.warn(
"Detected a valid signing condition which was rejected by slashing-protection (block {} for validator {})",
i,
block.getPublickKey());
block.getPublicKey());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@

public class AttestationTestModel {

private final Bytes publickKey;
private final Bytes publicKey;
private final UInt64 sourceEpoch;
private final UInt64 targetEpoch;
private final boolean shouldSucceed;
private final Bytes signingRoot;

public AttestationTestModel(
@JsonProperty(value = "pubkey", required = true) final Bytes publickKey,
@JsonProperty(value = "pubkey", required = true) final Bytes publicKey,
@JsonProperty(value = "source_epoch", required = true) UInt64 sourceEpoch,
@JsonProperty(value = "target_epoch", required = true) UInt64 targetEpoch,
@JsonProperty(value = "should_succeed", required = true) boolean shouldSucceed,
@JsonProperty(value = "signing_root") Bytes signingRoot) {
this.publickKey = publickKey;
this.publicKey = publicKey;
this.sourceEpoch = sourceEpoch;
this.targetEpoch = targetEpoch;
this.shouldSucceed = shouldSucceed;
this.signingRoot = signingRoot;
}

public Bytes getPublickKey() {
return publickKey;
public Bytes getPublicKey() {
return publicKey;
}

public UInt64 getSourceEpoch() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@

public class BlockTestModel {

private final Bytes publickKey;
private final Bytes publicKey;
private final UInt64 slot;
private final Bytes signingRoot;
private final boolean shouldSucceed;

public BlockTestModel(
@JsonProperty(value = "pubkey", required = true) final Bytes publickKey,
@JsonProperty(value = "pubkey", required = true) final Bytes publicKey,
@JsonProperty(value = "slot", required = true) UInt64 slot,
@JsonProperty(value = "should_succeed", required = true) boolean shouldSucceed,
@JsonProperty(value = "signing_root") Bytes signingRoot) {
this.publickKey = publickKey;
this.publicKey = publicKey;
this.slot = slot;
this.shouldSucceed = shouldSucceed;
this.signingRoot = signingRoot;
}

public Bytes getPublickKey() {
return publickKey;
public Bytes getPublicKey() {
return publicKey;
}

public UInt64 getSlot() {
Expand Down

0 comments on commit b20bd47

Please sign in to comment.