Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIS-3 NFT] Fix nonce event serialization #423

Merged
merged 3 commits into from
May 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/cis3-nft-sponsored-txs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ pub enum Event {
/// tracks the nonce used by the signer of the `PermitMessage`.
#[derive(Debug, Serialize, SchemaType, PartialEq, Eq)]
pub struct NonceEvent {
/// Account that signed the `PermitMessage`.
pub account: AccountAddress,
/// The nonce that was used in the `PermitMessage`.
pub nonce: u64,
/// Account that signed the `PermitMessage`.
pub account: AccountAddress,
}

// Implementing a custom schemaType to the `Event` combining all CIS2/CIS3
Expand All @@ -110,8 +110,8 @@ impl schema::SchemaType for Event {
(
"Nonce".to_string(),
schema::Fields::Named(vec![
(String::from("account"), AccountAddress::get_type()),
(String::from("nonce"), u64::get_type()),
(String::from("account"), AccountAddress::get_type()),
]),
),
);
Expand Down Expand Up @@ -871,8 +871,8 @@ fn contract_permit(

// Log the nonce event.
logger.log(&Event::Nonce(NonceEvent {
account: param.signer,
nonce,
account: param.signer,
}))?;

Ok(())
Expand Down
Loading