Skip to content

Commit a00913a

Browse files
authored
chore(hermes): Minor cleanup (typos & formatting) (#701)
* Cleanup * Further cleanup
1 parent 0136378 commit a00913a

File tree

6 files changed

+52
-55
lines changed

6 files changed

+52
-55
lines changed

hermes/bin/src/runtime_extensions/hermes/cardano/host.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl HostNetwork for HermesRuntimeContext {
164164
///
165165
/// Note: For both `+n` and `-n`, the `start` does not need to be a true block.
166166
/// They will return the block which appears at this block offset, given the
167-
/// arbitrary start point. IF the `start` block does exist, it will never
167+
/// arbitrary start point. If the `start` block does exist, it will never be
168168
/// returned with a positive or negative `step`, as it is `step` 0.
169169
///
170170
/// Example, Given three consecutive blocks at slots `100`, `200` and `300` the

hermes/bin/src/runtime_extensions/hermes/localtime/host.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl Host for HermesRuntimeContext {
1616
///
1717
/// `when` : The datetime we want to convert (Optional, if not set it will convert
1818
/// `now`).
19-
/// `tz` : The timezone to use. (Optional, if not set uses the local machines
19+
/// `tz` : The timezone to use. (Optional, if not set uses the machine's
2020
/// configured local timezone.)
2121
///
2222
/// **Returns**
@@ -36,7 +36,7 @@ impl Host for HermesRuntimeContext {
3636
/// **Parameters**
3737
///
3838
/// `time` : The localtime to convert.
39-
/// `tz` : The timezone to use. (Optional, if not set uses the local machines
39+
/// `tz` : The timezone to use. (Optional, if not set uses the machine's
4040
/// configured local timezone.)
4141
///
4242
/// **Returns**

wasm/wasi/wit/deps/hermes-cardano/api.wit

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ interface api {
3939
/// The live tip of the blockchain, following the upstream node.
4040
tip,
4141
/// The immutable tip of the blockchain
42-
/// e.g., The last block which has reached the absolute finality and can never rolls back.
42+
/// e.g., The last block which has reached the absolute finality and can never roll back.
4343
immutable-tip,
4444
}
4545

@@ -56,7 +56,7 @@ interface api {
5656
/// Unknown network.
5757
unknown-network
5858
}
59-
59+
6060
/// Errors that can happen for block.
6161
enum block-error {
6262
/// Block is not found.
@@ -76,9 +76,9 @@ interface api {
7676
/// **Parameters**
7777
///
7878
/// - `network`: The Cardano network to connect to (e.g., Mainnet, Preprod, Preview).
79-
///
79+
///
8080
/// **Returns**
81-
///
81+
///
8282
/// - `ok(network)`: A resource network, if successfully create network resource.
8383
/// - `error(create-network-error)`: If creating network resource failed.
8484
new: static func(network: cardano-network) -> result<network, create-network-error>;
@@ -94,54 +94,52 @@ interface api {
9494
///
9595
/// **Returns**
9696
///
97-
/// - `ok(u32)`: A unsigned integer represent the underlying 32-bit representation of subscription ID
98-
/// resource. this subscription. Use to distinguishes events from different subscribers
99-
/// and provides control over subscription management.The ID must be unique across all
100-
/// active subscriptions.
97+
/// - `ok(u32)`: A unsigned integer representing the underlying 32-bit subscription resource ID.
98+
/// This is used to distinguish events from different subscribers and provides
99+
/// control over subscription management.The ID must be unique across all active subscriptions.
101100
/// - `error(subscribe-error)`: If subscription failed.
102101
subscribe-block: func(start: sync-slot) -> result<u32, subscribe-error>;
103102

104103
/// Subscribe to blockchain immutable rolls forward.
105104
///
106105
/// This sets up a subscription to receive event when the immutable part of the blockchain
107106
/// roll forwards.
108-
///
107+
///
109108
/// **Parameters**
110109
///
111110
/// - `start`: The slot to begin following from.
112-
///
111+
///
113112
/// **Returns**
114-
///
115-
/// - `ok(u32)`: A unsigned integer represent the underlying 32-bit representation of subscription ID
116-
/// resource. this subscription. Use to distinguishes events from different subscribers
117-
/// and provides control over subscription management.The ID must be unique across all
118-
/// active subscriptions.
113+
///
114+
/// - `ok(u32)`: A unsigned integer representing the underlying 32-bit subscription resource ID.
115+
/// This is used to distinguish events from different subscribers and provides
116+
/// control over subscription management.The ID must be unique across all active subscriptions.
119117
/// - `error(subscribe-error)`: If subscription failed.
120118
subscribe-immutable-roll-forward: func(start: sync-slot) -> result<u32, subscribe-error>;
121119

122120
/// Get a block relative to `start` by `step`.
123121
///
124122
/// **Parameters**
125123
/// - `start`: Slot to begin retrieval from, current tip if `None`.
126-
/// - `step`
127-
/// -`0` : the block at `start`, will return `None` if there is no block exactly at this `start` slot.
128-
/// -`+n`: the `n`‑th block *after* the given `start` slot.
129-
/// –`‑n`: the `n`‑th block *before* the given `start` slot.
130-
///
131-
/// Note: For both `+n` and `-n`, the `start` does not need to be a true block.
132-
/// They will return the block which appears at this block offset, given the arbitrary start point.
133-
/// IF the `start` block does exist, it will never returned with a positive or negative `step`, as it is `step` 0.
134-
///
135-
/// Example, Given three consecutive blocks at slots `100`, `200` and `300` the following will be returned:
124+
/// - `step`
125+
/// -`0` : the block at `start`, will return `None` if there is no block exactly at this `start` slot.
126+
/// -`+n`: the `n`‑th block *after* the given `start` slot.
127+
/// –`‑n`: the `n`‑th block *before* the given `start` slot.
128+
///
129+
/// Note: For both `+n` and `-n`, the `start` does not need to be a true block.
130+
/// They will return the block which appears at this block offset, given the arbitrary start point.
131+
/// If the `start` block does exist, it will never be returned with a positive or negative `step`, as it is `step` 0.
132+
///
133+
/// Example, Given three consecutive blocks at slots `100`, `200` and `300` the following will be returned:
136134
/// - `start = 100, step = 0` -> 100 (Exact match)
137135
/// - `start = 100, step = 2` -> 300 (Skips 200)
138136
/// - `start = 150, step = 1` -> 200 (Rounds up from 150)
139137
/// - `start = 200, step = 1` -> 300 (Forward iteration)
140138
/// - `start = 300, step = -2` -> 100 (Skips 200)
141139
/// - `start = 250, step = -2` -> 100 (Rounds down to 200 first)
142-
///
140+
///
143141
/// **Returns**
144-
///
142+
///
145143
/// - Returns a `block` resource, `None` if block cannot be retrieved.
146144
get-block: func(start: option<slot>, step: s64) -> option<block>;
147145

@@ -166,12 +164,12 @@ interface api {
166164
/// - `false` if the block is in the mutable part.
167165
is-immutable: func() -> bool;
168166

169-
/// Returns whether the block is the first block of a rollback.
170-
///
171-
/// **Returns**
172-
///
167+
/// Returns whether the block is the first block of a rollback.
168+
///
169+
/// **Returns**
170+
///
173171
/// - `ok(bool)` True if the block is the first block of a rollback,
174-
/// otherwise, False.
172+
/// otherwise, False.
175173
/// - `error(block-error)`: If block cannot be retrieved.
176174
is-rollback: func() -> result<bool, block-error>;
177175

@@ -224,7 +222,7 @@ interface api {
224222
/// **Parameters**
225223
///
226224
/// - `label`: A metadata label used as a key to get the associated metadata.
227-
///
225+
///
228226
/// **Returns**
229227
///
230228
/// - `option<cbor>` : The CBOR format of the metadata, `None` if the label requested is not present.
@@ -234,12 +232,12 @@ interface api {
234232
/// Returns the transaction hash.
235233
///
236234
/// **Returns**
237-
///
235+
///
238236
/// - `option<txn-hash>` : Cardano transaction hash - Blake2b-256, `None` if cannot retrieve the transaction hash.
239237
get-txn-hash: func() -> option<txn-hash>;
240238

241239
/// Returns the raw CBOR representation of the transaction.
242-
///
240+
///
243241
/// **Returns**
244242
///
245243
/// - `option<cbor>` : The CBOR format of the transaction, `None` if cannot retrieve the raw transaction.
@@ -248,13 +246,13 @@ interface api {
248246

249247
resource subscription-id {
250248
/// Returns the network that this subscription is in.
251-
///
249+
///
252250
/// **Returns**
253-
///
251+
///
254252
/// - `cardano-network` : The Cardano network that this subscription is in.
255253
get-network: func() -> cardano-network;
256254

257-
255+
258256
/// Unsubscribing block event of this `subscription-id` instance.
259257
/// Once this function is called, the subscription instance, `subscription-id` will be removed.
260258
unsubscribe: func();

wasm/wasi/wit/deps/hermes-cron/api.wit

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ interface api {
3636
tag: cron-event-tag
3737
}
3838

39-
/// A discreet time entry used to help convert numeric times into crontab entries.
39+
/// A discrete time entry used to help convert numeric times into crontab entries.
4040
variant cron-component {
4141
// Maps to `*` in a cron schedule (ie, match all)
4242
all,
4343
// Match an absolute time/date
4444
at(u8),
4545
// Match an inclusive list of time/date values.
46-
range(tuple<u8,u8>),
46+
range(tuple<u8, u8>),
4747
}
4848

4949
/// A list of cron time components
@@ -114,7 +114,7 @@ interface api {
114114
/// - A list of tuples containing the scheduled crontabs and their tags, along with the current retrigger flag.
115115
/// The list is sorted from most crontab that will trigger soonest to latest.
116116
/// Crontabs are only listed once, in the case where a crontab may be scheduled
117-
/// may times before a later one.
117+
/// many times before a later one.
118118
/// - `0` - `cron-tagged` - The Tagged crontab event.
119119
/// - `1` - `bool` - The state of the retrigger flag.
120120
///
@@ -138,7 +138,7 @@ interface api {
138138

139139
/// # Make a crontab entry from individual time values.
140140
///
141-
/// Crates the properly formatted cron entry
141+
/// Creates the properly formatted cron entry
142142
/// from numeric cron time components.
143143
/// Convenience function to make building cron strings simpler when they are
144144
/// calculated from data.
@@ -162,12 +162,11 @@ interface api {
162162
/// Redundant entries will be removed.
163163
/// - For example specifying a `month` as `3` and `2-4` will
164164
/// remove the individual month and only produce the range.
165-
mkcron: func(dow: cron-time, month: cron-time, day: cron-time,
166-
hour: cron-time, minute: cron-time ) -> cron-sched;
165+
mkcron: func(dow: cron-time, month: cron-time, day: cron-time,
166+
hour: cron-time, minute: cron-time ) -> cron-sched;
167167
}
168168

169169
/// World just for the Hermes 'cron' API and Event.
170170
world cron-api {
171171
import api;
172172
}
173-

wasm/wasi/wit/deps/hermes-ipfs/api.wit

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ interface api {
77
/// This is content that can be validated.
88
variant ipfs-content {
99
/// DHT value
10-
dht(tuple<dht-key,dht-value>),
11-
pubsub(tuple<pubsub-topic,message-data>),
10+
dht(tuple<dht-key, dht-value>),
11+
pubsub(tuple<pubsub-topic, message-data>),
1212
}
1313
/// The binary contents of an IPFS file.
1414
type ipfs-file = list<u8>;
@@ -24,7 +24,7 @@ interface api {
2424
type pubsub-topic = string;
2525
/// A PubSub message from a topic subscription.
2626
record pubsub-message {
27-
/// The topic that the message was received on.
27+
/// The topic that the message was received on.
2828
topic: pubsub-topic,
2929
/// The contents of the message.
3030
message: message-data,
@@ -79,9 +79,9 @@ interface api {
7979
file-pin: func(path: ipfs-path) -> result<bool, errno>;
8080
/// Un-pins an IPFS file by path.
8181
file-unpin: func(path: ipfs-path) -> result<bool, errno>;
82-
/// Evict peer from network.
82+
/// Evicts peer from network.
8383
peer-evict: func(peer: peer-id) -> result<bool, errno>;
84-
/// Publish a message to a topic.
84+
/// Publishes a message to a topic.
8585
pubsub-publish: func(topic: pubsub-topic, message: message-data) -> result<_, errno>;
8686
/// Subscribes to a PubSub topic.
8787
pubsub-subscribe: func(topic: pubsub-topic) -> result<bool, errno>;

wasm/wasi/wit/deps/hermes-localtime/api.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ interface api {
4444
/// **Parameters**
4545
///
4646
/// `when` : The datetime we want to convert (Optional, if not set it will convert `now`).
47-
/// `tz` : The timezone to use. (Optional, if not set uses the local machines configured local timezone.)
47+
/// `tz` : The timezone to use. (Optional, if not set uses the machine's configured local timezone.)
4848
///
4949
/// **Returns**
5050
///
@@ -59,7 +59,7 @@ interface api {
5959
/// **Parameters**
6060
///
6161
/// `time` : The localtime to convert.
62-
/// `tz` : The timezone to use. (Optional, if not set uses the local machines configured local timezone.)
62+
/// `tz` : The timezone to use. (Optional, if not set uses the machine's configured local timezone.)
6363
///
6464
/// **Returns**
6565
///

0 commit comments

Comments
 (0)