Skip to content

Commit

Permalink
Fix event comment (#1315)
Browse files Browse the repository at this point in the history
### What

Context - stellar/stellar-protocol#1522

The second commit for unwrap.rs is required due to
rust-lang/rust#129031.
  • Loading branch information
sisuresh authored Aug 15, 2024
1 parent d40bd03 commit 48fc0e4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 33 deletions.
18 changes: 9 additions & 9 deletions soroban-sdk/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub trait TokenInterface {
/// # Events
///
/// Emits an event with topics `["transfer", from: Address, to: Address],
/// data = [amount: i128]`
/// data = amount: i128`
fn transfer(env: Env, from: Address, to: Address, amount: i128);

/// Transfer `amount` from `from` to `to`, consuming the allowance that
Expand All @@ -164,7 +164,7 @@ pub trait TokenInterface {
/// # Events
///
/// Emits an event with topics `["transfer", from: Address, to: Address],
/// data = [amount: i128]`
/// data = amount: i128`
fn transfer_from(env: Env, spender: Address, from: Address, to: Address, amount: i128);

/// Burn `amount` from `from`.
Expand All @@ -180,8 +180,8 @@ pub trait TokenInterface {
///
/// # Events
///
/// Emits an event with topics `["burn", from: Address], data = [amount:
/// i128]`
/// Emits an event with topics `["burn", from: Address], data = amount:
/// i128`
fn burn(env: Env, from: Address, amount: i128);

/// Burn `amount` from `from`, consuming the allowance of `spender`.
Expand All @@ -204,8 +204,8 @@ pub trait TokenInterface {
///
/// # Events
///
/// Emits an event with topics `["burn", from: Address], data = [amount:
/// i128]`
/// Emits an event with topics `["burn", from: Address], data = amount:
/// i128`
fn burn_from(env: Env, spender: Address, from: Address, amount: i128);

/// Returns the number of decimals used to represent amounts of this token.
Expand Down Expand Up @@ -286,7 +286,7 @@ pub trait StellarAssetInterface {
/// # Events
///
/// Emits an event with topics `["mint", admin: Address, to: Address], data
/// = [amount: i128]`
/// = amount: i128`
fn mint(env: Env, to: Address, amount: i128);

/// Clawback `amount` from `from` account. `amount` is burned in the
Expand All @@ -301,7 +301,7 @@ pub trait StellarAssetInterface {
/// # Events
///
/// Emits an event with topics `["clawback", admin: Address, to: Address],
/// data = [amount: i128]`
/// data = amount: i128`
fn clawback(env: Env, from: Address, amount: i128);
}

Expand Down Expand Up @@ -330,7 +330,7 @@ pub(crate) const SPEC_XDR_INPUT: &[&[u8]] = &[
&StellarAssetSpec::spec_xdr_transfer_from(),
];

pub(crate) const SPEC_XDR_LEN: usize = 6460;
pub(crate) const SPEC_XDR_LEN: usize = 6456;

impl StellarAssetSpec {
/// Returns the XDR spec for the Token contract.
Expand Down
3 changes: 3 additions & 0 deletions soroban-sdk/src/unwrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ impl<T> UnwrapInfallible for Result<T, Infallible> {
// destructuring the `never` variable into an empty set of cases is
// the most honest since it's statically checked to _be_ infallible,
// not just an assertion of our hopes.)

// This allow and the Err can be removed once 1.82 becomes stable
#[allow(unreachable_patterns)]
Err(never) => match never {},
}
}
Expand Down
58 changes: 34 additions & 24 deletions tests/fuzz/fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48fc0e4

Please sign in to comment.