Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
deuszex committed Aug 16, 2024
1 parent e992eed commit 56e483f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
12 changes: 6 additions & 6 deletions contract/src/events/events_cep47.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ pub fn emit_cep47(event: Event) {
event.insert(PREFIX_HASH_KEY_NAME, package);
event.insert(EVENT_TYPE, "Mint".to_string());
event.insert(RECIPIENT, event_in.recipient.to_string());
event.insert(TOKEN_ID, event_in.token_id.to_string());
event.insert(TOKEN_ID, event_in.token_id);
event
}
Event::Burn(event_in) => {
let mut event = BTreeMap::new();
event.insert(PREFIX_HASH_KEY_NAME, package);
event.insert(EVENT_TYPE, "Burn".to_string());
event.insert(OWNER, event_in.owner.to_string());
event.insert(TOKEN_ID, event_in.token_id.to_string());
event.insert(TOKEN_ID, event_in.token_id);
event.insert(BURNER, event_in.burner.to_string());
event
}
Expand All @@ -58,15 +58,15 @@ pub fn emit_cep47(event: Event) {
event.insert(EVENT_TYPE, "Approve".to_string());
event.insert(OWNER, event_in.owner.to_string());
event.insert(SPENDER, event_in.spender.to_string());
event.insert(TOKEN_ID, event_in.token_id.to_string());
event.insert(TOKEN_ID, event_in.token_id);
event
}
Event::ApprovalRevoked(event_in) => {
let mut event = BTreeMap::new();
event.insert(PREFIX_HASH_KEY_NAME, package);
event.insert(EVENT_TYPE, "ApprovalRevoked".to_string());
event.insert(OWNER, event_in.owner.to_string());
event.insert(TOKEN_ID, event_in.token_id.to_string());
event.insert(TOKEN_ID, event_in.token_id);
event
}
Event::ApprovalForAll(event_in) => {
Expand Down Expand Up @@ -97,14 +97,14 @@ pub fn emit_cep47(event: Event) {
},
);
event.insert(RECIPIENT, event_in.recipient.to_string());
event.insert(TOKEN_ID, event_in.token_id.to_string());
event.insert(TOKEN_ID, event_in.token_id);
event
}
Event::MetadataUpdated(event_in) => {
let mut event = BTreeMap::new();
event.insert(PREFIX_HASH_KEY_NAME, package);
event.insert(EVENT_TYPE, "MetadataUpdate".to_string());
event.insert(TOKEN_ID, event_in.token_id.to_string());
event.insert(TOKEN_ID, event_in.token_id);
event
}
Event::Migration(_) => {
Expand Down
2 changes: 1 addition & 1 deletion contract/src/events/events_native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn emit_native_string(event: Event) {

pub fn emit_native_bytes(event: Event) {
let payload_data = event.to_json();
let payload = MessagePayload::from_bytes(&payload_data.as_bytes())
let payload = MessagePayload::from_bytes(payload_data.as_bytes())
.unwrap_or_revert()
.0;
runtime::emit_message(EVENTS, &payload).unwrap_or_revert()
Expand Down
6 changes: 2 additions & 4 deletions contract/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2798,14 +2798,12 @@ pub extern "C" fn call() {
Ok(_) => install_contract(),
Err(e) => {
if e as u8 == NFTCoreError::MissingCollectionSymbol as u8 {
let collection_name = get_named_arg::<String>(
ARG_COLLECTION_NAME
);
let collection_name = get_named_arg::<String>(ARG_COLLECTION_NAME);
migrate_contract(
format!("{PREFIX_ACCESS_KEY_NAME}_{collection_name}"),
format!("{PREFIX_HASH_KEY_NAME}_{collection_name}"),
);
}else{
} else {
revert(e)
}
}
Expand Down
5 changes: 4 additions & 1 deletion tests/src/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ use casper_types::{
ProtocolVersion,
};
use contract::{
constants::{ARG_COLLECTION_NAME, ARG_EVENTS_MODE, ARG_NAMED_KEY_CONVENTION, ARG_TOKEN_META_DATA, ARG_TOKEN_OWNER, COLLECTION_NAME},
constants::{
ARG_COLLECTION_NAME, ARG_EVENTS_MODE, ARG_NAMED_KEY_CONVENTION, ARG_TOKEN_META_DATA,
ARG_TOKEN_OWNER, COLLECTION_NAME,
},
modalities::{EventsMode, NamedKeyConventionMode},
};

Expand Down

0 comments on commit 56e483f

Please sign in to comment.