Skip to content

Commit 7e815fd

Browse files
committed
docs: fix comments for swap functions
The comments imply that all paths besides the first 2 will be ignored.
1 parent 35e6bef commit 7e815fd

File tree

1 file changed

+6
-6
lines changed
  • substrate/frame/asset-conversion/src

1 file changed

+6
-6
lines changed

substrate/frame/asset-conversion/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -725,14 +725,14 @@ pub mod pallet {
725725
}
726726

727727
impl<T: Config> Pallet<T> {
728-
/// Swap exactly `amount_in` of asset `path[0]` for asset `path[1]`.
728+
/// Swap exactly `amount_in` of asset `path[0]` for asset `path[last]`.
729729
/// If an `amount_out_min` is specified, it will return an error if it is unable to acquire
730730
/// the amount desired.
731731
///
732-
/// Withdraws the `path[0]` asset from `sender`, deposits the `path[1]` asset to `send_to`,
732+
/// Withdraws the `path[0]` asset from `sender`, deposits the `path[last]` asset to `send_to`,
733733
/// respecting `keep_alive`.
734734
///
735-
/// If successful, returns the amount of `path[1]` acquired for the `amount_in`.
735+
/// If successful, returns the amount of `path[last]` acquired for the `amount_in`.
736736
///
737737
/// WARNING: This may return an error after a partial storage mutation. It should be used
738738
/// only inside a transactional storage context and an Err result must imply a storage
@@ -773,14 +773,14 @@ pub mod pallet {
773773
Ok(amount_out)
774774
}
775775

776-
/// Take the `path[0]` asset and swap some amount for `amount_out` of the `path[1]`. If an
776+
/// Take the `path[0]` asset and swap some amount for `amount_out` of the `path[last]`. If an
777777
/// `amount_in_max` is specified, it will return an error if acquiring `amount_out` would be
778778
/// too costly.
779779
///
780-
/// Withdraws `path[0]` asset from `sender`, deposits the `path[1]` asset to `send_to`,
780+
/// Withdraws `path[0]` asset from `sender`, deposits the `path[last]` asset to `send_to`,
781781
/// respecting `keep_alive`.
782782
///
783-
/// If successful returns the amount of the `path[0]` taken to provide `path[1]`.
783+
/// If successful returns the amount of the `path[0]` taken to provide `path[last]`.
784784
///
785785
/// WARNING: This may return an error after a partial storage mutation. It should be used
786786
/// only inside a transactional storage context and an Err result must imply a storage

0 commit comments

Comments
 (0)