Skip to content

Commit 57a0507

Browse files
authored
Fix typos in tests/polkadot.rs (#1791)
One is in an assertion message. All others are in comments. Signed-off-by: Samuel Moelius <samuel.moelius@trailofbits.com>
1 parent 787d103 commit 57a0507

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/polkadot.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl Contract {
141141
Ok((store, instance))
142142
}
143143

144-
/// Execute this contract at the exportet function `name` in the given `runtime` context.
144+
/// Execute this contract at the exported function `name` in the given `runtime` context.
145145
///
146146
/// On success, returns the Wasm store including the runtime state is returned.
147147
/// On failure, returns the Wasm execution Error together with the debug buffer.
@@ -221,9 +221,9 @@ struct Runtime {
221221
input: Option<Vec<u8>>,
222222
/// The output of the contract execution.
223223
output: HostReturn,
224-
/// Descirbes how much value was given to the contract call.
224+
/// Describes how much value was given to the contract call.
225225
transferred_value: u128,
226-
/// Combined ouptut of all `seal_debug_message` calls
226+
/// Combined output of all `seal_debug_message` calls
227227
debug_buffer: String,
228228
/// Stores all events emitted during contract execution.
229229
events: Vec<Event>,
@@ -262,7 +262,7 @@ impl Runtime {
262262
runtime
263263
}
264264

265-
/// After a succesfull contract execution, merge the runtime context of the callee back.
265+
/// After a successful contract execution, merge the runtime context of the callee back.
266266
///
267267
/// We take over accounts (the callee might deploy new ones), debug buffer and emitted events.
268268
/// The transferred balance will now be deducted from the caller.
@@ -767,7 +767,7 @@ impl Runtime {
767767
output_ptr: u32,
768768
output_len_ptr: u32,
769769
) -> Result<u32, Trap> {
770-
assert_eq!(id, 123, "unkown chain extension");
770+
assert_eq!(id, 123, "unknown chain extension");
771771
assert!(read_len(mem, output_len_ptr) == 16384 && input_len <= 16384);
772772

773773
let mut data = read_buf(mem, input_ptr, input_len);
@@ -825,7 +825,7 @@ impl MockSubstrate {
825825
Ok(())
826826
}
827827

828-
/// Overwrites the address at asssociated `account` index with the given `address`.
828+
/// Overwrites the address at associated `account` index with the given `address`.
829829
pub fn set_account_address(&mut self, account: usize, address: [u8; 32]) {
830830
self.0.data_mut().accounts[account].address = address;
831831
}
@@ -899,7 +899,7 @@ impl MockSubstrate {
899899
self.raw_constructor(input);
900900
}
901901

902-
/// Get a list of all uploaded cotracts
902+
/// Get a list of all uploaded contracts
903903
pub fn blobs(&self) -> Vec<WasmCode> {
904904
self.0.data().blobs.clone()
905905
}
@@ -1031,15 +1031,15 @@ impl MockSubstrate {
10311031
}
10321032
}
10331033

1034-
/// Build all contracts foud in `src` and set up a mock runtime.
1034+
/// Build all contracts found in `src` and set up a mock runtime.
10351035
///
10361036
/// The mock runtime will contain a contract account for each contract in `src`.
10371037
/// Constructors are _not_ called, therefore the storage will not be initialized.
10381038
pub fn build_solidity(src: &str) -> MockSubstrate {
10391039
build_solidity_with_options(src, true)
10401040
}
10411041

1042-
/// A variant of `MockSubstrate::uild_solidity()` with the ability to specify compiler options:
1042+
/// A variant of `MockSubstrate::build_solidity()` with the ability to specify compiler options:
10431043
/// * log_ret: enable logging of host function return codes
10441044
/// * log_err: enable logging of runtime errors
10451045
pub fn build_solidity_with_options(src: &str, log_err: bool) -> MockSubstrate {

0 commit comments

Comments
 (0)