Skip to content

Commit

Permalink
Check spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
clint419 committed Dec 21, 2023
1 parent e4dd06f commit 4c26118
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 33 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ jobs:
scarb-version: "2.3.1"
- run: scarb fmt --check
- run: scarb build
- run: scarb test
- run: scarb test
# https://github.com/crate-ci/typos/blob/master/docs/github-action.md
- name: check spelling
uses: crate-ci/typos@master
2 changes: 1 addition & 1 deletion docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ NET=<network name> npm run setL1RemoteGateway -- --help
NET=<network name> npm run setL2RemoteGateway -- --help
```

- Set zkLink to L2 gatway
- Set zkLink to L2 gateway

```sh
NET=<network name> npm run setL2GatewayToZkLink -- --help
Expand Down
2 changes: 1 addition & 1 deletion docs/setup_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In order to install and use `cairo`, install the following:
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh -s -- -v 2.3.1
```

**If you need upgrade, just run the instllation scripts with new version again, and checkout to the newest tag, and rebuild the project.**
**If you need upgrade, just run the installation scripts with new version again, and checkout to the newest tag, and rebuild the project.**

After that, open a new shell and check that the following command returns a version number:

Expand Down
2 changes: 1 addition & 1 deletion scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const NOTICE_PERIOD = "NoticePeriod";
// command
const COMMAND_BUILD = "scarb --release build";

// connetion type
// connection type
const DECLARE = "declare";
const DEPLOY = "deploy";

Expand Down
16 changes: 8 additions & 8 deletions src/contracts/multicall.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ trait IMulticall<TContractState> {
fn multiStaticCall(self: @TContractState, _targets: Array<Call>) -> Array<MulticallResult>;
fn multicall(ref self: TContractState, _targets: Array<Call>) -> Array<MulticallResult>;
fn batchWithdrawToL1(
ref self: TContractState, _zklink: ContractAddress, _withdrawDatas: Array<WithdrawToL1Info>
ref self: TContractState, _zklink: ContractAddress, _withdrawData: Array<WithdrawToL1Info>
);
fn batchWithdrawPendingBalance(
ref self: TContractState,
_zklink: ContractAddress,
_withdrawDatas: Array<WithdrawPendingBalanceInfo>
_withdrawData: Array<WithdrawPendingBalanceInfo>
);
}

Expand Down Expand Up @@ -102,11 +102,11 @@ mod Multicall {
fn batchWithdrawToL1(
ref self: ContractState,
_zklink: ContractAddress,
_withdrawDatas: Array<WithdrawToL1Info>
_withdrawData: Array<WithdrawToL1Info>
) {
let mut _withdrawDatas = _withdrawDatas;
let mut _withdrawData = _withdrawData;
loop {
match _withdrawDatas.pop_front() {
match _withdrawData.pop_front() {
Option::Some(withdrawToL1Info) => {
let mut calldata: Array<felt252> = array![];
Serde::serialize(@withdrawToL1Info.owner, ref calldata);
Expand All @@ -132,11 +132,11 @@ mod Multicall {
fn batchWithdrawPendingBalance(
ref self: ContractState,
_zklink: ContractAddress,
_withdrawDatas: Array<WithdrawPendingBalanceInfo>
_withdrawData: Array<WithdrawPendingBalanceInfo>
) {
let mut _withdrawDatas = _withdrawDatas;
let mut _withdrawData = _withdrawData;
loop {
match _withdrawDatas.pop_front() {
match _withdrawData.pop_front() {
Option::Some(withdrawPendingBalanceInfo) => {
let mut calldata: Array<felt252> = array![];
Serde::serialize(@withdrawPendingBalanceInfo.owner, ref calldata);
Expand Down
4 changes: 2 additions & 2 deletions src/contracts/zklink.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod Zklink {
#[key]
tokenId: u16,
#[key]
recepient: u256,
recipient: u256,
amount: u128
}

Expand Down Expand Up @@ -1654,7 +1654,7 @@ mod Zklink {
.emit(
Event::WithdrawalPending(
WithdrawalPending {
tokenId: _tokenId, recepient: recipient, amount: _amount
tokenId: _tokenId, recipient: recipient, amount: _amount
}
)
);
Expand Down
18 changes: 9 additions & 9 deletions src/tests/test_block_commit.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -336,13 +336,13 @@ fn test_zklink_collectOnchainOps_success() {
let (
actual_processableOperationsHash,
actual_priorityOperationsProcessed,
actual_currentOnchainOperationPubdataHashs
actual_currentOnchainOperationPubdataHashes
) =
dispatcher
.testCollectOnchainOps(block);
assert(actual_processableOperationsHash == processableOpPubdataHash, 'invaid value1');
assert(actual_priorityOperationsProcessed == priorityOperationsProcessed, 'invaid value2');
assert(actual_currentOnchainOperationPubdataHashs == onchainOpPubdataHash, 'invaid value3');
assert(actual_processableOperationsHash == processableOpPubdataHash, 'invalid value1');
assert(actual_priorityOperationsProcessed == priorityOperationsProcessed, 'invalid value2');
assert(actual_currentOnchainOperationPubdataHashes == onchainOpPubdataHash, 'invalid value3');
}


Expand Down Expand Up @@ -515,9 +515,9 @@ fn test_zklink_testCommitOneBlock_commit_compressed_block() {
);

let r: StoredBlockInfo = dispatcher.testCommitOneBlock(preBlock, compressedBlock);
assert(r.blockNumber == blockNumber, 'invaid value1');
assert(r.blockSequence == preBlock.blockSequence + 1, 'invaid value2');
assert(r.priorityOperations == priorityOperationsProcessed, 'invaid value3');
assert(r.pendingOnchainOperationsHash == processableOpPubdataHash, 'invaid value4');
assert(r.syncHash == syncHash, 'invaid value5');
assert(r.blockNumber == blockNumber, 'invalid value1');
assert(r.blockSequence == preBlock.blockSequence + 1, 'invalid value2');
assert(r.priorityOperations == priorityOperationsProcessed, 'invalid value3');
assert(r.pendingOnchainOperationsHash == processableOpPubdataHash, 'invalid value4');
assert(r.syncHash == syncHash, 'invalid value5');
}
4 changes: 2 additions & 2 deletions src/tests/test_exodus.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn test_zklink_activateExodusMode_twice() {
let amount: u128 = 1000000000000000000; // 1 Ether

// expire block is zero in unit test environment
// cairo-test defualt block number is 0
// cairo-test default block number is 0
set_block_number(5);
set_contract_address(defaultSender);
eth_dispatcher.mint(amount.into() * 10);
Expand All @@ -87,7 +87,7 @@ fn test_zklink_activateExodusMode_twice() {
zklink_dispatcher.activateExodusMode();
utils::assert_event_ExodusMode(zklink, true);

// active agian should failed
// active again should failed
zklink_dispatcher.activateExodusMode();
}

Expand Down
6 changes: 3 additions & 3 deletions src/tests/test_governance.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn test_zklink_add_token_invalid_decimals() {
#[test]
#[available_gas(20000000000)]
#[should_panic(expected: ('I2', 'ENTRYPOINT_FAILED'))]
fn test_zklink_add_token_registed_1() {
fn test_zklink_add_token_registered_1() {
let address = prepare_test_deploy();

let defaultSender: ContractAddress = *address[utils::ADDR_DEFAULT];
Expand All @@ -177,7 +177,7 @@ fn test_zklink_add_token_registed_1() {
#[test]
#[available_gas(20000000000)]
#[should_panic(expected: ('I2', 'ENTRYPOINT_FAILED'))]
fn test_zklink_add_token_registed_2() {
fn test_zklink_add_token_registered_2() {
let address = prepare_test_deploy();

let defaultSender: ContractAddress = *address[utils::ADDR_DEFAULT];
Expand Down Expand Up @@ -249,7 +249,7 @@ fn test_zklink_pause_token_not_governor() {
#[test]
#[available_gas(20000000000)]
#[should_panic(expected: ('K', 'ENTRYPOINT_FAILED'))]
fn test_zklink_pause_token_not_registed() {
fn test_zklink_pause_token_not_registered() {
let address = prepare_test_deploy();

let defaultSender: ContractAddress = *address[utils::ADDR_DEFAULT];
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_pending_withdraw.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use zklink::utils::data_structures::DataStructures::StoredBlockInfo;
#[test]
#[available_gas(20000000000)]
#[should_panic(expected: ('b0', 'ENTRYPOINT_FAILED'))]
fn test_zklink_withdrawPendingBalance_token_unregisted() {
fn test_zklink_withdrawPendingBalance_token_unregistered() {
let (addrs, tokens) = utils::prepare_test_deploy();
let defaultSender = *addrs[utils::ADDR_DEFAULT];
let zklink = *addrs[utils::ADDR_ZKLINK];
Expand Down
4 changes: 2 additions & 2 deletions src/tests/test_priority.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn test_zklink_deposit_erc20_exodus() {
#[test]
#[available_gas(20000000000)]
#[should_panic(expected: ('e3', 'ENTRYPOINT_FAILED'))]
fn test_zklink_deposit_token_unregisted() {
fn test_zklink_deposit_token_unregistered() {
let (addrs, _) = utils::prepare_test_deploy();
let defaultSender = *addrs[utils::ADDR_DEFAULT];
let zklink = *addrs[utils::ADDR_ZKLINK];
Expand Down Expand Up @@ -471,7 +471,7 @@ fn test_zklink_fullexit_subaccountid_too_large() {
#[test]
#[available_gas(20000000000)]
#[should_panic(expected: ('a2', 'ENTRYPOINT_FAILED'))]
fn test_zklink_fullexit_token_unregisted() {
fn test_zklink_fullexit_token_unregistered() {
let (addrs, tokens) = utils::prepare_test_deploy();
let defaultSender = *addrs[utils::ADDR_DEFAULT];
let zklink = *addrs[utils::ADDR_ZKLINK];
Expand Down
4 changes: 2 additions & 2 deletions src/tests/utils.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ fn assert_event_ExodusMode(zklink: ContractAddress, exodusMode: bool) {
}

fn assert_event_WithdrawalPending(
zklink: ContractAddress, _tokenId: u16, _recepient: u256, _amount: u128
zklink: ContractAddress, _tokenId: u16, _recipient: u256, _amount: u128
) {
let event = pop_log::<Zklink::WithdrawalPending>(zklink).unwrap();
assert(event.tokenId == _tokenId, 'tokenId');
assert(event.recepient == _recepient, 'recepient');
assert(event.recipient == _recipient, 'recipient');
assert(event.amount == _amount, 'amount');
}

Expand Down
8 changes: 8 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[files]
extend-exclude = ["*.tsv", "*.json", "*.txt"]

[default.extend-words]
# Ignore false-positives

[default.extend-identifiers]
# *sigh* this just isn't worth the cost of fixing

0 comments on commit 4c26118

Please sign in to comment.