Skip to content

Commit

Permalink
Merge pull request #22 from gear-foundation/tm/minor-fix
Browse files Browse the repository at this point in the history
Fix notify event
  • Loading branch information
MedovTimur authored Aug 29, 2024
2 parents 56bb007 + adafda0 commit e39dc6c
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 15 deletions.
Binary file removed .DS_Store
Binary file not shown.
Binary file removed extended-vft/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions extended-vft/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
./wasm/.binpath
./wasm/.DS_Store
/.DS_Store
6 changes: 4 additions & 2 deletions extended-vft/app/src/services/extended_vft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ impl ExtendedService {
funcs::mint(Storage::balances(), Storage::total_supply(), to, value)
});
if mutated {
let _ = self.notify_on(Event::Minted { to, value });
self.notify_on(Event::Minted { to, value })
.expect("Notification Error");
}
mutated
}
Expand All @@ -84,7 +85,8 @@ impl ExtendedService {
funcs::burn(Storage::balances(), Storage::total_supply(), from, value)
});
if mutated {
let _ = self.notify_on(Event::Burned { from, value });
self.notify_on(Event::Burned { from, value })
.expect("Notification Error");
}
mutated
}
Expand Down
Binary file removed extended-vft/wasm/.DS_Store
Binary file not shown.
Binary file removed extended-vnft/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions extended-vnft/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
./wasm/.binpath
./wasm/.DS_Store
/.DS_Store
6 changes: 4 additions & 2 deletions extended-vnft/app/src/services/extended_vnft/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ impl ExtendedService {
token_metadata.clone(),
)
});
let _ = self.notify_on(Event::Minted { to, token_metadata });
self.notify_on(Event::Minted { to, token_metadata })
.expect("Notification Error");
}

pub fn burn(&mut self, from: ActorId, token_id: TokenId) {
Expand All @@ -113,7 +114,8 @@ impl ExtendedService {
token_id,
)
});
let _ = self.notify_on(Event::Burned { from, token_id });
self.notify_on(Event::Burned { from, token_id })
.expect("Notification Error");
}

pub fn grant_admin_role(&mut self, to: ActorId) {
Expand Down
Binary file removed extended-vnft/wasm/.DS_Store
Binary file not shown.
Binary file removed vft-service/.DS_Store
Binary file not shown.
3 changes: 2 additions & 1 deletion vft-service/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
./wasm/.binpath
./wasm/.DS_Store
/.DS_Store

11 changes: 7 additions & 4 deletions vft-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ impl Service {
let mutated = funcs::approve(&mut storage.allowances, owner, spender, value);

if mutated {
let _ = self.notify_on(Event::Approval {
self.notify_on(Event::Approval {
owner,
spender,
value,
});
})
.expect("Notification Error");
}

mutated
Expand All @@ -103,7 +104,8 @@ impl Service {
utils::panicking(move || funcs::transfer(&mut storage.balances, from, to, value));

if mutated {
let _ = self.notify_on(Event::Transfer { from, to, value });
self.notify_on(Event::Transfer { from, to, value })
.expect("Notification Error");
}

mutated
Expand All @@ -124,7 +126,8 @@ impl Service {
});

if mutated {
let _ = self.notify_on(Event::Transfer { from, to, value });
self.notify_on(Event::Transfer { from, to, value })
.expect("Notification Error");
}

mutated
Expand Down
Binary file removed vnft-service/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion vnft-service/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/target
./wasm/.binpath
./wasm/.DS_Store
/.DS_Store
13 changes: 8 additions & 5 deletions vnft-service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ impl Service {
token_id,
)
});
let _ = self.notify_on(Event::Approval {
self.notify_on(Event::Approval {
owner,
approved,
token_id,
});
})
.expect("Notification Error");
}

pub fn transfer(&mut self, to: ActorId, token_id: TokenId) {
Expand All @@ -110,11 +111,12 @@ impl Service {
)
});

let _ = self.notify_on(Event::Transfer {
self.notify_on(Event::Transfer {
from: source,
to,
token_id,
});
})
.expect("Notification Error");
}

pub fn transfer_from(&mut self, from: ActorId, to: ActorId, token_id: TokenId) {
Expand All @@ -131,7 +133,8 @@ impl Service {
)
});

let _ = self.notify_on(Event::Transfer { from, to, token_id });
self.notify_on(Event::Transfer { from, to, token_id })
.expect("Notification Error");
}

pub fn balance_of(&self, owner: ActorId) -> U256 {
Expand Down

0 comments on commit e39dc6c

Please sign in to comment.