Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add typo checker in CI #1481

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/typo-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Typo Checker
on: [pull_request]

jobs:
run:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v2
- name: Check spelling of the entire repository
uses: crate-ci/typos@v1.11.1
3 changes: 3 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[files]
extend-exclude = ["framework/scenario/src/scenario/model/transaction/tx_response.rs"]

12 changes: 6 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ They are:
## [sc 0.39.5, vm 0.1.5] - 2023-02-06
- `multiversx-sc-meta` improvements:
- Rust snippet generator fixes. The generator creates compilable code with appropriate argument types.
- `local-deps` command: generates a report on the local depedencies of contract crates. Will explore indirect depdencies too.
- `local-deps` command: generates a report on the local dependencies of contract crates. Will explore indirect dependencies too.
- Upgrade tool minor fix.

## [sc 0.39.4, vm 0.1.4] - 2023-01-26
Expand All @@ -266,7 +266,7 @@ They are:

## [sc 0.39.1, codec 0.17.1, vm 0.1.1, scenario-format 0.19.1, sdk 0.1.1] - 2023-01-18
- `multiversx-sc-meta` can be installed as a standalone tool (`sc-meta`), and used to automatically upgrade contracts.
- Many depedencies updates across the repo.
- Many dependencies updates across the repo.
- Updated readme files.

## [sc 0.39.0, codec 0.17.0, vm 0.1.0, scenario-format 0.19.0, sdk 0.1.0] - 2023-01-12
Expand Down Expand Up @@ -534,7 +534,7 @@ They are:
- Made the generated code in `wasm/lib.rs` more compact with the use of macros.

## [elrond-wasm 0.22.0] - 2021-11-02
- Mechanism for generating contract endpoints based on ABI. Previously, all endpoints from all modules from a crate were automaticaly included, now they can be filtered based on what modules are used.
- Mechanism for generating contract endpoints based on ABI. Previously, all endpoints from all modules from a crate were automatically included, now they can be filtered based on what modules are used.
- Contract `meta` crates are now capable of building the respective contracts and the ABIs without relying on `erdpy`.
- Renamed feature `arwen-tests` to `mandos-go-tests`

Expand Down Expand Up @@ -621,7 +621,7 @@ They are:
- Send API refactored for more consistency and ease of use.
- High level proxies can be used to deploy contracts.
- Mandos log syntax updated, to match Arwen.
- A better `#[only_owner]` annotation, which can be applied directly to endoint methods. This annotation also shows up in the ABI.
- A better `#[only_owner]` annotation, which can be applied directly to endpoint methods. This annotation also shows up in the ABI.
- `elrond-wasm-derive` now an optional dependency of `elrond-wasm`. Use `#[elrond_wasm::contract]` instead of `#[elrond_wasm_derive::contract]` now. Same for proxies and modules.

## [elrond-wasm 0.17.4] - 2021-06-30
Expand Down Expand Up @@ -776,7 +776,7 @@ They are:
- ABI generation of endpoint output names

## [elrond-wasm 0.10.2, elrond-codec 0.4.2] - 2020-12-28
- Codec type hygene
- Codec type hygiene

## [elrond-wasm 0.10.1, elrond-codec 0.4.1, mandos 0.4.1] - 2020-12-23
- Minor fixes, support for strings
Expand Down Expand Up @@ -931,7 +931,7 @@ They are:
- Async call contract proxy infrastructure

## [elrond-wasm 0.1.0] - 2020-02-05
- Initial relase of the framework
- Initial release of the framework
- Main features at this time:
- contract main macro
- handling of arguments and results automagically using macros
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/bonding-curve-contract/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The payment was chosen to be stored under a storage named `BondingCurve` because

Here the balance and the payment amount are variable and they will usually get changed together, reason why it was chosen for these elements to be kept away from `token_details`.

**Important!** Only 1 seller can have a specific token to be sold at a time, avoiding this way scenarion of which token from which seller should be selled at one point.
**Important!** Only 1 seller can have a specific token to be sold at a time, avoiding this way scenario of which token from which seller should be selled at one point.

There is an option of `sell_availability` which can be set from the `init` of the contract allowing or denying a token once bought by a buyer to be sold back.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl<M: ManagedTypeApi> CurveFunction<M> for FunctionSelector<M> {
&(&sum * &sum * sum / 3u32) + &arguments.balance + initial_cost.clone()
},
FunctionSelector::None => {
M::error_api_impl().signal_error(b"Bonding Curve function is not assiged")
M::error_api_impl().signal_error(b"Bonding Curve function is not assigned")
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/crypto-kitties/common/random/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub struct Random {

// usually, types should create their own `random` instance,
// but because standalone types can't create a random seed
// (due to no access to blockhain functions),
// (due to no access to blockchain functions),
// the method will use a provided `random` instance
pub trait Randomizeable {
fn get_random(random: &mut Random) -> Self;
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/crypto-kitties/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ This function ends the auction for the kitty if one of the end conditions has be

Anyone may call this function, not only the ones involved in the auction.

If this was a selling auction, the `current_bid` is sent to the `kitty_owner` and the kitty's ownership is transfered to `current_winner`. Auction is then cleared from storage.
If this was a selling auction, the `current_bid` is sent to the `kitty_owner` and the kitty's ownership is transferred to `current_winner`. Auction is then cleared from storage.

If this was a siring auction, the `current_bid` is sent to the `kitty_owner` and the kitty's `sire_allowed_address` is set to `current_winner`.

Expand Down Expand Up @@ -233,7 +233,7 @@ fn init(
)
```

Each breeding will cost a fixed amount of eGLD. The birth operation can cost a lot of gas, depending on the implementation of the genetic algortihm, so whoever calls the give_birth method (will be discussed later) will get the deposited `birth_fee`.
Each breeding will cost a fixed amount of eGLD. The birth operation can cost a lot of gas, depending on the implementation of the genetic algorithm, so whoever calls the give_birth method (will be discussed later) will get the deposited `birth_fee`.

The next two arguments are the addresses of the other two contracts: the kitty-auction contract and the kitty-genetic-alg contract. These can either be set now or later by the owner, using the appropriate setter methods.

Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/digital-cash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In order to fund one should first call `deposit_fees` depositing the fee funds a

`fund` after making sure everything is ok on the fee aspect will set up the `deposit` storage increasing the number of tokens to transfer by the number of tokens paid to the endpoint and set the expiration date by the number of rounds specified within the `valability` parameter.

The fees are unique per address and only cover one instance of transfer, either if it is a `claim` or a `forward`, per number of tokens transfered. Only by making one of these actions will consume the fee funds following to to refund the rest of the fees to the depositor.
The fees are unique per address and only cover one instance of transfer, either if it is a `claim` or a `forward`, per number of tokens transferred. Only by making one of these actions will consume the fee funds following to to refund the rest of the fees to the depositor.

## Claiming funds

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pay-fee-adn-fund-egld",
"name": "pay-fee-and-fund-egld",
"steps": [
{
"step": "externalSteps",
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/digital-cash/src/signature_operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ pub trait SignatureOperationsModule: storage::StorageModule + helpers::HelpersMo

let block_round = self.blockchain().get_block_round();
let deposit = deposit_mapper.take();
let num_tokens_transfered = deposit.get_num_tokens();
let num_tokens_transferred = deposit.get_num_tokens();
let mut deposited_fee = deposit.fees.value;

let fee_token = deposited_fee.token_identifier.clone();
let fee = self.fee(&fee_token).get();
require!(deposit.expiration_round >= block_round, "deposit expired");

let fee_cost = fee * num_tokens_transfered as u64;
let fee_cost = fee * num_tokens_transferred as u64;
deposited_fee.amount -= &fee_cost;

self.collected_fees(&fee_token)
Expand Down
10 changes: 5 additions & 5 deletions contracts/examples/esdt-transfer-with-fee/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Interaction

The contract allows transfering token with the `ESDTRoleTransfer` role.
The contract allows transferring token with the `ESDTRoleTransfer` role.

The owner can set a fee for the contract, being one of 2 possible types:

- `ExactValue` - `EsdtTokenPayment` type with desired token + amount per token transfered
- `Percentage` - % of the transfered token (this number is multiplied by 100 so that we can have 2 decimal percentages. ex.: 12,50% percentage fee will be set with 1250)
- `ExactValue` - `EsdtTokenPayment` type with desired token + amount per token transferred
- `Percentage` - % of the transferred token (this number is multiplied by 100 so that we can have 2 decimal percentages. ex.: 12,50% percentage fee will be set with 1250)

The transfer endpoint requires the tokens having a `ExactValue` type fee to have the fee as the following token in exact amount.
The `Percentage` type will make the fee to be taken from the value transfered.
The `Percentage` type will make the fee to be taken from the value transferred.

Tokens that have no fee set will be simply transfered without additional requirements.
Tokens that have no fee set will be simply transferred without additional requirements.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl MultisigInteract {
println!("proposing issue collection with all roles...");
let action_id = self.propose_issue_collection_with_all_roles().await;

println!("perfoming issue collection with all roles action `{action_id}`...");
println!("performing issue collection with all roles action `{action_id}`...");

if !self.quorum_reached(action_id).await && !self.sign(action_id).await {
return;
Expand Down Expand Up @@ -126,7 +126,7 @@ impl MultisigInteract {
println!("proposing issue collection...");
let action_id = self.propose_issue_collection().await;

println!("perfoming issue collection action `{action_id}`...");
println!("performing issue collection action `{action_id}`...");

if !self.quorum_reached(action_id).await && !self.sign(action_id).await {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ impl MultisigInteract {
println!("proposing wrap egld...");
let action_id = self.propose_wrap_egld().await;

println!("perfoming wrap egld action `{action_id}`...");
println!("performing wrap egld action `{action_id}`...");
self.perform_action(action_id, "15,000,000").await;
}

pub async fn unwrap_egld(&mut self) {
println!("proposing unwrap egld...");
let action_id = self.propose_unwrap_egld().await;

println!("perfoming unwrap egld action `{action_id}`...");
println!("performing unwrap egld action `{action_id}`...");
self.perform_action(action_id, "15,000,000").await;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/nft-minter/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fn issue_token(&self, token_name: ManagedBuffer, token_ticker: ManagedBuffer)

The endpoint needs a 0.05 EGLD payment for the token issue (note: if you use mxpy directly, you need to pass 0.05 * 10^18 as --value, i.e. 50000000000000000).

`token_name` is the disply name that will be shown on the explorer in the user's balance, while `token_ticker` is the prefix of the token identifier that will be created. The token identifier is the token ticker + a dash (`-`) and 6 random hex characters. This is done to be able to differentiate between tokens with the same ticker. More information can be found here: https://docs.multiversx.com/tokens/esdt-tokens
`token_name` is the display name that will be shown on the explorer in the user's balance, while `token_ticker` is the prefix of the token identifier that will be created. The token identifier is the token ticker + a dash (`-`) and 6 random hex characters. This is done to be able to differentiate between tokens with the same ticker. More information can be found here: https://docs.multiversx.com/tokens/esdt-tokens

Once the issue is complete, you have to set the NFTCreate local role, which can be done through the `setLocalRoles` endpoint. No arguments and no payment required.

Expand Down
2 changes: 1 addition & 1 deletion contracts/examples/order-book/pair/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::{
#[multiversx_sc::module]
pub trait ValidationModule: common::CommonModule {
fn require_valid_order_input_amount(&self, params: &OrderInputParams<Self::Api>) {
require!(params.amount != BigUint::zero(), "Amout cannot be zero");
require!(params.amount != BigUint::zero(), "Amount cannot be zero");
require!(
self.calculate_fee_amount(
&params.amount,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "try to ping the wrong ammount of funds",
"name": "try to ping the wrong amount of funds",
"gasSchedule": "v3",
"steps": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn ping_pong_call_ping_twice_go() {
}

#[test]
fn ping_pong_call_ping_wrong_ammount_go() {
fn ping_pong_call_ping_wrong_amount_go() {
world().run("scenarios/ping-pong-call-ping-wrong-ammount.scen.json");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ fn ping_pong_call_ping_twice_rs() {
}

#[test]
fn ping_pong_call_ping_wrong_ammount_rs() {
fn ping_pong_call_ping_wrong_amount_rs() {
world().run("scenarios/ping-pong-call-ping-wrong-ammount.scen.json");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"tx": {
"from": "address:an_account",
"to": "sc:alloc-features",
"function": "echo_ser_example_1",
"function": "echo_set_example_1",
"arguments": [
{
"0-int": "u16:0",
Expand Down Expand Up @@ -71,7 +71,7 @@
"tx": {
"from": "address:an_account",
"to": "sc:alloc-features",
"function": "echo_boxed_ser_example_1",
"function": "echo_boxed_set_example_1",
"arguments": [
{
"3-uint_32": "u32:5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ pub trait Parent {
initial_supply: BigUint,
) {
let issue_cost = self.call_value().egld_value();
let child_contract_adress = self.child_contract_address().get();
let child_contract_address = self.child_contract_address().get();
let _: IgnoreValue = self
.child_proxy(child_contract_adress)
.child_proxy(child_contract_address)
.issue_wrapped_egld(token_display_name, token_ticker, initial_supply)
.with_egld_transfer(issue_cost.clone_value())
.with_gas_limit(ISSUE_EXPECTED_GAS_COST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ multiversx_sc::imports!();
/// TODO: split into modules
#[multiversx_sc::contract]
pub trait ForwarderRaw:
forwarder_raw_alt_init::ForwarderRawAlterativeInit
forwarder_raw_alt_init::ForwarderRawAlternativeInit
+ forwarder_raw_common::ForwarderRawCommon
+ forwarder_raw_async::ForwarderRawAsync
+ forwarder_raw_sync::ForwarderRawSync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ multiversx_sc::imports!();
/// We are using the multi-contract build system, to avoid having too many SC crates.
/// We need to generate a separate contract for each of these constructors.
#[multiversx_sc::module]
pub trait ForwarderRawAlterativeInit: super::forwarder_raw_common::ForwarderRawCommon {
pub trait ForwarderRawAlternativeInit: super::forwarder_raw_common::ForwarderRawCommon {
/// Will not work, only written for VM testing.
///
/// Async calls are explicitly forbidden in constructors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ pub trait ForwarderRawAsync: super::forwarder_raw_common::ForwarderRawCommon {

ContractCallWithMultiEsdt::<Self::Api, ()>::new(
to,
"burn_and_create_retrive_async",
"burn_and_create_retrieve_async",
all_payments,
)
.async_call()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ pub trait BackTransfersFeatureModule {
);
}

#[event("back_tranfers")]
#[event("back_transfers")]
fn back_transfers_event(
&self,
#[indexed] egld_value: &BigUint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"address": "sc:forwarder",
"endpoint": "str:forward_sync_retrieve_funds_bt",
"topics": [
"str:back_tranfers",
"str:back_transfers",
"1000"
],
"data": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"address": "sc:forwarder",
"endpoint": "str:forward_sync_retrieve_funds_bt",
"topics": [
"str:back_tranfers",
"str:back_transfers",
"0",
"str:TEST-TOKENA",
"0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"address": "sc:forwarder",
"endpoint": "str:forward_sync_retrieve_funds_bt",
"topics": [
"str:back_tranfers",
"str:back_transfers",
"0",
"str:NFT-000001",
"5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ fn forwarder_sync_echo_go() {
}

#[test]
fn forwarder_tranfer_esdt_with_fees_go() {
fn forwarder_transfer_esdt_with_fees_go() {
world().run("scenarios/forwarder_tranfer_esdt_with_fees.scen.json");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ fn forwarder_sync_echo_rs() {
}

#[test]
fn forwarder_tranfer_esdt_with_fees_rs() {
fn forwarder_transfer_esdt_with_fees_rs() {
world().run("scenarios/forwarder_tranfer_esdt_with_fees.scen.json");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
USER_PEM=""
USER_ADDRESS_BECH32=
USER_ADDDRESS_HEX="0x$(mxpy wallet bech32 --decode ${USER_ADDRESS_BECH32})"
USER_ADDRESS_HEX="0x$(mxpy wallet bech32 --decode ${USER_ADDRESS_BECH32})"

RECEIVER_ADDRESS_BECH32=
RECEIVER_ADDRESS_HEX="0x$(mxpy wallet bech32 --decode ${RECEIVER_ADDRESS_BECH32})"
Expand Down
2 changes: 1 addition & 1 deletion contracts/feature-tests/composability/vault/src/vault.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ pub trait Vault {

#[payable("*")]
#[endpoint]
fn burn_and_create_retrive_async(&self) {
fn burn_and_create_retrieve_async(&self) {
let payments = self.call_value().all_esdt_transfers();
let mut uris = ManagedVec::new();
uris.push(ManagedBuffer::new());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ multiversx_sc_wasm_adapter::endpoints! {
retrieve_funds_with_transfer_exec => retrieve_funds_with_transfer_exec
retrieve_funds => retrieve_funds
retrieve_multi_funds_async => retrieve_multi_funds_async
burn_and_create_retrive_async => burn_and_create_retrive_async
burn_and_create_retrieve_async => burn_and_create_retrieve_async
get_owner_address => get_owner_address
call_counts => call_counts
num_called_retrieve_funds_promises => num_called_retrieve_funds_promises
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ multiversx_sc_wasm_adapter::endpoints! {
retrieve_funds_with_transfer_exec => retrieve_funds_with_transfer_exec
retrieve_funds => retrieve_funds
retrieve_multi_funds_async => retrieve_multi_funds_async
burn_and_create_retrive_async => burn_and_create_retrive_async
burn_and_create_retrieve_async => burn_and_create_retrieve_async
get_owner_address => get_owner_address
call_counts => call_counts
num_called_retrieve_funds_promises => num_called_retrieve_funds_promises
Expand Down
Loading
Loading