Skip to content

Commit

Permalink
chore: fix typos across the repo (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgorenflo authored Mar 4, 2024
1 parent b93af44 commit aad015b
Show file tree
Hide file tree
Showing 37 changed files with 202 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/actions/release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ runs:
Please check the tags and use the patch commit as the base for the
new release.
Retreive the latest patch commit from the tag:
Retrieve the latest patch commit from the tag:
git tag --list ${{inputs.binary-to-release}}-v*
Checkout the tag:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
type: choice
options:
- ampd
- agggregate-verifier
- aggregate-verifier
- connection-router
- gateway
- multisig
Expand Down
29 changes: 22 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
# Axelar Amplifier

The Interchain Amplifier enables developers to permissionlessly set up connections to the Axelar network. Developers gain access to Axelar's interconnected network of chains and can "amplify" their resources by paying the cost equivalent to developing only one connection. They can establish connections between new ecosystems or existing chains to add new network properties, such as improved security or better delivery and availability.
The Interchain Amplifier enables developers to permissionlessly set up connections to the Axelar network. Developers
gain access to Axelar's interconnected network of chains and can "amplify" their resources by paying the cost equivalent
to developing only one connection. They can establish connections between new ecosystems or existing chains to add new
network properties, such as improved security or better delivery and availability.

### Documentation

High level documentation and diagrams can be found in the [doc](doc/README.md) directory.

### Contract Json Schemas
Json schemas for types used in the contract apis can be generated by navigating to the `./contracts/{contract_name}` directory and running `cargo schema`. This will generate a `./contracts/{contract_name}/schema` directory containing the json schemas for types used to instantiate, execute, query etc.

Json schemas for types used in the contract apis can be generated by navigating to the `./contracts/{contract_name}`
directory and running `cargo schema`. This will generate a `./contracts/{contract_name}/schema` directory containing the
json schemas for types used to instantiate, execute, query etc.

### Development and Testing

When developing contracts to integrate with amplifier, the `cw-multi-test` crate can be used to create a simulated blockchain environment, where different contracts can deployed and interacted with, and contracts can interact with each other. See the [integration-tests](integration-tests) package for examples, as well as reusable helper functions.
When developing contracts to integrate with amplifier, the `cw-multi-test` crate can be used to create a simulated
blockchain environment, where different contracts can be deployed and interacted with, and contracts can interact with
each other. See the [integration-tests](integration-tests) package for examples, as well as reusable helper functions.

### Versioning

The semver for new releases is calculated automatically based on the commit messages and the folders where changes were made. The configuration for each piece of software released (e.g ampd, gateway...) can be seen in the release.yaml file. You can perform a dry-run using the release action to be sure that the next version is what you intend it to be. The basic rules are as follows:
- a commit with a message that does not include any associated tag (e.g major-contracts) for release will be considered a patch release
- a commit with a message with minor tag e.g `feat(minor-ampd):...` will be considered a minor release, and the same logic applies to major releases
- if no changes are detected in the watched directories, the release will not bump the version. For example, if since last release for the gateway contract no changes were made in the `contracts/gateway` or `packages/` directory. A new release will not bump the version.
The semver for new releases is calculated automatically based on the commit messages and the folders where changes were
made. The configuration for each piece of software released (e.g. ampd, gateway...) can be seen in the release.yaml
file. You can perform a dry-run using the release action to be sure that the next version is what you intend it to be.
The basic rules are as follows:

- a commit with a message that does not include any associated tag (e.g. major-contracts) for release will be considered
a patch release
- a commit with a message with minor tag e.g. `feat(minor-ampd):...` will be considered a minor release, and the same
logic applies to major releases
- if no changes are detected in the watched directories, the release will not bump the version. For example, if since
last release for the gateway contract no changes were made in the `contracts/gateway` or `packages/` directory. A new
release will not bump the version.
2 changes: 1 addition & 1 deletion ampd/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ mod tests {
}

#[test]
fn deserialize_handlers_more_then_one_for_mulsitig_signer() {
fn deserialize_handlers_more_then_one_for_multisig_signer() {
let config_str = format!(
"
[[handlers]]
Expand Down
6 changes: 3 additions & 3 deletions contracts/aggregate-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Aggregate verifier contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions contracts/connection-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Connection router contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions contracts/gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Gateway contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
6 changes: 3 additions & 3 deletions contracts/multisig-prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Multisig prover contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion contracts/multisig-prover/src/encoding/bcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pub fn encode(data: &Data) -> HexBinary {
pub fn msg_digest(command_batch: &CommandBatch) -> HexBinary {
// Sui is just mimicking EVM here
let unsigned = [
"\x19Sui Signed Message:\n".as_bytes(), // Keccek256 hash length = 32
"\x19Sui Signed Message:\n".as_bytes(), // Keccak256 hash length = 32
encode(&command_batch.data).as_slice(),
]
.concat();
Expand Down
6 changes: 3 additions & 3 deletions contracts/multisig/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Multisig contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion contracts/multisig/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum Event {
chain_name: ChainName,
expires_at: u64,
},
// Emitted when a participants submits a signature
// Emitted when a participant submits a signature
SignatureSubmitted {
session_id: Uint64,
participant: Addr,
Expand Down
2 changes: 1 addition & 1 deletion contracts/multisig/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub enum ExecuteMsg {
AuthorizeCaller {
contract_address: Addr,
},
// Unauthorizes a contract so it can no longer call StartSigningSession.
// Unauthorizes a contract, so it can no longer call StartSigningSession.
UnauthorizeCaller {
contract_address: Addr,
},
Expand Down
6 changes: 3 additions & 3 deletions contracts/rewards/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Validator rewards contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion contracts/rewards/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ mod tests {
);
assert!(res.is_ok());

// need to change the block height so we can claim rewards
// need to change the block height, so we can claim rewards
let old_height = app.block_info().height;
app.set_block(BlockInfo {
height: old_height + u64::from(initial_params.epoch_duration) * 2,
Expand Down
4 changes: 2 additions & 2 deletions contracts/rewards/src/contract/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ mod test {
.is_err());
}

/// Tests that the current epoch is computed correctly when the expected epoch is different than the stored epoch
/// Tests that the current epoch is computed correctly when the expected epoch is different from the stored epoch
#[test]
fn current_epoch_different_epoch() {
let cur_epoch_num = 1u64;
Expand Down Expand Up @@ -896,7 +896,7 @@ mod test {
}

// we add 2 epochs worth of rewards. There were 2 epochs of participation, but only 2 epochs where rewards should be given out
// This tests we are accounting correctly, and only removing from the pool when we actually give out rewards
// These tests we are accounting correctly, and only removing from the pool when we actually give out rewards
let rewards_added = 2 * rewards_per_epoch;
let _ = contract.add_rewards(
pool_id.clone(),
Expand Down
4 changes: 2 additions & 2 deletions contracts/rewards/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ mod test {
assert!(loaded.is_ok());
assert!(loaded.unwrap().is_none());

// save the first water mark
// save the first watermark
let res = store.save_rewards_watermark(pool_id.clone(), epoch.epoch_num);
assert!(res.is_ok());

Expand Down Expand Up @@ -541,7 +541,7 @@ mod test {
assert!(loaded.is_ok());
assert!(loaded.unwrap().is_none());

// save the first water mark for this contract
// save the first watermark for this contract
let res = store.save_rewards_watermark(diff_pool_id.clone(), epoch.epoch_num + 7);
assert!(res.is_ok());

Expand Down
6 changes: 3 additions & 3 deletions contracts/service-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Contract handling the service registrations"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion contracts/service-registry/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl TryFrom<Worker> for Participant {
match worker.bonding_state {
BondingState::Bonded { amount: _ } => Ok(Self {
address: worker.address,
// Weight is set to one to ensure all workers have same weight. In future it should be derived from amount bonded
// Weight is set to one to ensure all workers have same weight. In the future, it should be derived from amount bonded
// If the weight is changed to a non-constant value, the signing session completed event from multisig and the signature
// optimization during proof construction may require re-evaluation, so that relayers could take advantage of late
// signatures to get a more optimized version of the proof.
Expand Down
2 changes: 1 addition & 1 deletion contracts/service-registry/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ fn deregister_previously_unsupported_single_chain() {
assert_eq!(workers, vec![])
}

/// If a unbonded but authorized worker deregisters support for a chain they previously registered support for,
/// If an unbonded but authorized worker deregisters support for a chain they previously registered support for,
/// that worker should not be part of the active worker set for that chain.
#[test]
fn register_and_deregister_support_for_single_chain_unbonded() {
Expand Down
6 changes: 3 additions & 3 deletions contracts/voting-verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2021"
description = "Voting verifier contract"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
# Those files are rust-optimizer artifacts. You might want to commit them for convenience, but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion contracts/voting-verifier/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ mod test {
);

// 3. Retry verification. From the three messages that reached consensus, only the first two have a
// status considered final (SucceddedOnChan or FailedOnChain), so the last two are retried
// status considered final (SucceededOnChan or FailedOnChain), so the last two are retried

let res = execute(
deps.as_mut(),
Expand Down
2 changes: 1 addition & 1 deletion contracts/voting-verifier/src/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ pub struct TxEventConfirmation {
pub destination_chain: ChainName,
pub source_address: Address,
/// for better user experience, the payload hash gets encoded into hex at the edges (input/output),
/// but internally, we treat it as raw bytes to enforce it's format.
/// but internally, we treat it as raw bytes to enforce its format.
#[serde(with = "axelar_wasm_std::hex")]
#[schemars(with = "String")] // necessary attribute in conjunction with #[serde(with ...)]
pub payload_hash: [u8; 32],
Expand Down
5 changes: 3 additions & 2 deletions doc/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## How to read the docs

You can directly navigate through the markdown files [here](./src) or build the book locally using `mdbook`.
You can directly navigate through the markdown files [here](src) or build the book locally using `mdbook`.

## Prerequisites to build book

Expand Down Expand Up @@ -32,4 +32,5 @@ mdbook serve doc --open

## Contributing

Information about how to contribute to the documentation can be found in the documentation chapter [here](http://localhost:3000/contributing/documentation.html)
Information about how to contribute to the documentation can be found in the documentation
chapter [here](http://localhost:3000/contributing/documentation.html)
20 changes: 10 additions & 10 deletions doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Summary

[Overview](./overview.md)
[Overview](overview.md)

# Contracts

- [Service Registry](./contracts/service_registry.md)
- [Connection Router](./contracts/connection_router.md)
- [Multisig](./contracts/multisig.md)
- [Gateway](./contracts/gateway.md)
- [Aggregate Verifier](./contracts/aggregate_verifier.md)
- [Voting Verifier](./contracts/voting_verifier.md)
- [Multisig Prover](./contracts/multisig_prover.md)
- [Rewards](./contracts/rewards.md)
- [Service Registry](contracts/service_registry.md)
- [Connection Router](contracts/connection_router.md)
- [Multisig](contracts/multisig.md)
- [Gateway](contracts/gateway.md)
- [Aggregate Verifier](contracts/aggregate_verifier.md)
- [Voting Verifier](contracts/voting_verifier.md)
- [Multisig Prover](contracts/multisig_prover.md)
- [Rewards](contracts/rewards.md)

# Contributing

- [Documentation](./contributing/documentation.md)
- [Documentation](contributing/documentation.md)
Loading

0 comments on commit aad015b

Please sign in to comment.