Skip to content

Commit 020bec0

Browse files
committed
ci: detect typos
1 parent 26d45a4 commit 020bec0

File tree

17 files changed

+42
-23
lines changed

17 files changed

+42
-23
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ jobs:
3232
run: go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
3333
- name: Run all the linter tools against code
3434
run: make lint
35+
36+
typos:
37+
runs-on: ubuntu-latest
38+
timeout-minutes: 5
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: crate-ci/typos@392b78fe18a52790c53f42456e46124f77346842 # v1.34.0
3542

3643
gen-doc:
3744
name: Check gen-doc generated files

cmd/cdk/interfaces.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type validiumContractInterface interface {
9292
type committeeContractInterface interface {
9393
CommitteeHash(opts *bind.CallOpts) ([32]byte, error)
9494
GetAmountOfMembers(opts *bind.CallOpts) (*big.Int, error)
95-
GetProcotolName(opts *bind.CallOpts) (string, error)
95+
GetProtocolName(opts *bind.CallOpts) (string, error)
9696
Members(opts *bind.CallOpts, arg0 *big.Int) (struct {
9797
Url string
9898
Addr common.Address

cmd/cdk/rollup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ type RollupTypeData struct {
135135
type CommitteeData struct {
136136
CommitteeHash common.Hash `json:"committeeHash"`
137137
AmountOfMembers *big.Int `json:"amountOfMembers"`
138-
ProcotolName string `json:"procotolName"`
138+
ProtocolName string `json:"protocolName"`
139139
Members []CommitteeMemberData
140140
Owner common.Address `json:"owner"`
141141
RequiredAmountOfSignatures *big.Int `json:"requiredAmountOfSignatures"`
@@ -435,7 +435,7 @@ func getCommitteeData(committee committeeContractInterface) (*CommitteeData, err
435435
}
436436
time.Sleep(contractRequestInterval)
437437

438-
getProcotolName, err := committee.GetProcotolName(nil)
438+
getProtocolName, err := committee.GetProtocolName(nil)
439439
if err != nil {
440440
return nil, err
441441
}
@@ -469,7 +469,7 @@ func getCommitteeData(committee committeeContractInterface) (*CommitteeData, err
469469
return &CommitteeData{
470470
CommitteeHash: committeeHash,
471471
AmountOfMembers: getAmountOfMembers,
472-
ProcotolName: getProcotolName,
472+
ProtocolName: getProtocolName,
473473
Members: members,
474474
Owner: owner,
475475
RequiredAmountOfSignatures: requiredAmountOfSignatures,

cmd/fund/fund.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func deployOrInstantiateFunderContract(ctx context.Context, c *ethclient.Client,
127127
var err error
128128
if *params.FunderAddress == "" {
129129
// Deploy the Funder contract.
130-
// Note: `fundingAmountInWei` reprensents the amount the Funder contract will send to each newly generated wallets.
130+
// Note: `fundingAmountInWei` represents the amount the Funder contract will send to each newly generated wallets.
131131
fundingAmountInWei := params.FundingAmountInWei
132132
contractAddress, _, _, err = funder.DeployFunder(tops, c, fundingAmountInWei)
133133
if err != nil {
@@ -138,7 +138,7 @@ func deployOrInstantiateFunderContract(ctx context.Context, c *ethclient.Client,
138138

139139
// Fund the Funder contract.
140140
// Calculate the total amount needed to fund the contract based on the number of addresses.
141-
// Note: `funderContractBalanceInWei` reprensents the initial balance of the Funder contract.
141+
// Note: `funderContractBalanceInWei` represents the initial balance of the Funder contract.
142142
// The contract needs initial funds to be able to fund wallets.
143143
funderContractBalanceInWei := new(big.Int).Mul(fundingAmountInWei, big.NewInt(int64(numAddresses)))
144144
if err = util.SendTx(ctx, c, privateKey, &contractAddress, funderContractBalanceInWei, nil, uint64(30000)); err != nil {

cmd/loadtest/loadtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ func loadTestBlob(ctx context.Context, c *ethclient.Client, tops *bind.TransactO
18341834
},
18351835
}
18361836
// appendBlobCommitment() will take in the blobTx struct and append values to blob transaction specific keys in the following steps:
1837-
// The function will take in blobTx with empty BlobHashses, and Blob Sidecar variables initially.
1837+
// The function will take in blobTx with empty BlobHashes, and Blob Sidecar variables initially.
18381838
// Then generateRandomBlobData() is called to generate a byte slice with random values.
18391839
// createBlob() is called to commit the randomly generated byte slice with KZG.
18401840
// generateBlobCommitment() will do the same for the Commitment and Proof.

cmd/loadtest/loadtestUsage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,5 @@ The codebase has a contract that used for load testing. It's written in Solidity
7373
- `$ solc LoadTester.sol --bin --abi -o . --overwrite`
7474
3. Run `abigen`
7575
- `$ abigen --abi LoadTester.abi --pkg contracts --type LoadTester --bin LoadTester.bin --out loadtester.go`
76-
4. Run the loadtester to enure it deploys and runs successfully
76+
4. Run the loadtester to ensure it deploys and runs successfully
7777
- `$ polycli loadtest --verbosity 700 --rpc-url http://127.0.0.1:8541`

cmd/retest/retest.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ func (wr *WrappedData) ToSlice() []*WrappedData {
207207
if v.Len() == 0 {
208208
return []*WrappedData{}
209209
}
210-
wrappedDatas := make([]*WrappedData, v.Len())
210+
wrappedData := make([]*WrappedData, v.Len())
211211
for i := 0; i < v.Len(); i = i + 1 {
212212
nwd := new(WrappedData)
213213
nwd.raw = v.Index(i).Interface().(EthTestData)
214-
wrappedDatas[i] = nwd
214+
wrappedData[i] = nwd
215215

216216
}
217-
return wrappedDatas
217+
return wrappedData
218218
}
219219
func (wn *WrappedNumeric) IsSlice() bool {
220220
v := reflect.ValueOf(wn.raw)
@@ -229,14 +229,14 @@ func (wn *WrappedNumeric) ToSlice() []*WrappedNumeric {
229229
if v.Len() == 0 {
230230
return []*WrappedNumeric{}
231231
}
232-
wrappedDatas := make([]*WrappedNumeric, v.Len())
232+
wrappedData := make([]*WrappedNumeric, v.Len())
233233
for i := 0; i < v.Len(); i = i + 1 {
234234
nwd := new(WrappedNumeric)
235235
nwd.raw = v.Index(i).Interface().(EthTestData)
236-
wrappedDatas[i] = nwd
236+
wrappedData[i] = nwd
237237

238238
}
239-
return wrappedDatas
239+
return wrappedData
240240
}
241241
func EthTestNumericToBigInt(num EthTestNumeric) *big.Int {
242242
if num == nil {

cmd/signer/signer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ func (g *GCPKMS) Sign(ctx context.Context, tx *ethtypes.Transaction) error {
700700
ethSig = append(ethSig, bigIntTo32Bytes(parsedSig.S)...)
701701
ethSig = append(ethSig, 0)
702702

703-
// Feels like a hack, but I cna't figure out a better way to determine the recovery ID than this since google isn't returning it. More research is required
703+
// Feels like a hack, but I can't figure out a better way to determine the recovery ID than this since google isn't returning it. More research is required
704704
pubKey, err := crypto.Ecrecover(digest.Bytes(), ethSig)
705705
if err != nil || !bytes.Equal(pubKey, gcpPubKey.PublicKey.Bytes) {
706706
ethSig[64] = 1

cmd/ulxly/proofUsage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ This is the proof response from polycli:
6767
![Sample Tree](./tree-diagram.png)
6868

6969
When we're creating the proof here, we're essentially storing the paths to the
70-
various leafs. When we want to generate a proof, we find the appropriate sibling
70+
various leaves. When we want to generate a proof, we find the appropriate sibling
7171
node in the tree to prove that the leaf is part of the given merkle root.
7272

7373
## Full example

cmd/ulxly/rollupsProofUsage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,5 @@ This is the proof response from polycli:
6161
![Sample Tree](./tree-diagram.png)
6262

6363
When we're creating the proof here, we're essentially storing the paths to the
64-
various leafs. When we want to generate a proof, we find the appropriate sibling
64+
various leaves. When we want to generate a proof, we find the appropriate sibling
6565
node in the tree to prove that the leaf is part of the given merkle root.

0 commit comments

Comments
 (0)