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

refactor: api event naming conventions #286

Merged
merged 32 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
e8a3045
refactor: encoding scheme
Daanvdplas Sep 10, 2024
b16430b
tests: pallet api extension
Daanvdplas Sep 10, 2024
2179645
docs: tests
Daanvdplas Sep 10, 2024
dad4beb
refactor: remove unnecessary
Daanvdplas Sep 10, 2024
1c6f03a
test: primitives
Daanvdplas Sep 10, 2024
a51d619
style: naming variable
Daanvdplas Sep 10, 2024
9ff9915
test: devnet runtime versioning
Daanvdplas Sep 10, 2024
a2b9e76
test: runtime devnet mod (small tests)
Daanvdplas Sep 10, 2024
dc0f90a
refactor: fallible conversion
evilrobot-01 Sep 10, 2024
6f8205e
refactor: fallible conversion (#275)
evilrobot-01 Sep 11, 2024
1547dca
fix: tests after fallible conversion feat
Daanvdplas Sep 11, 2024
2b07130
rebase
Daanvdplas Sep 11, 2024
36e8735
fix: test after fallible conversion feat
Daanvdplas Sep 11, 2024
438de63
Merge branch 'daan/tests-pallet_api_extension' into daan/test-devnet_…
Daanvdplas Sep 11, 2024
a1ee377
test: config contracts
Daanvdplas Sep 11, 2024
8949e13
test: ensure signed test coverage
Daanvdplas Sep 11, 2024
d2eeb08
test: coverage fungibles pallet
Daanvdplas Sep 11, 2024
538b19e
fix: comment
Daanvdplas Sep 11, 2024
ca1ccca
test: error case test coverage
Daanvdplas Sep 12, 2024
1060a91
test: no state set test
Daanvdplas Sep 12, 2024
98e89dd
refactor: test variables
Daanvdplas Sep 12, 2024
0ad8b36
test: encoding read result
Daanvdplas Sep 12, 2024
682e8f3
refactor: pallet fungibles mod.rs
Daanvdplas Sep 13, 2024
db382a8
refactor: split tests and test badorigin first
Daanvdplas Sep 13, 2024
497b2f7
refactor: assets helper functions
Daanvdplas Sep 13, 2024
65ad654
refactor: api event naming conventions
chungquantin Sep 13, 2024
6163132
fix: formatting
chungquantin Sep 13, 2024
9b7a62d
fix: event naming
chungquantin Sep 13, 2024
b38aede
fix: formatting
chungquantin Sep 13, 2024
35bedb6
refactor: event Approve -> Approval
peterwht Sep 13, 2024
3df17e1
docs: add comment for differing event names
peterwht Sep 13, 2024
5d82f9f
merge daan/api attempt 2
Daanvdplas Sep 13, 2024
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
6 changes: 4 additions & 2 deletions pallets/api/src/fungibles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ pub mod pallet {
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
/// Event emitted when allowance by `owner` to `spender` changes.
// Differing style: event name abides by the PSP22 standard.
Approval {
/// The token.
token: TokenIdOf<T>,
Expand All @@ -147,6 +148,7 @@ pub mod pallet {
value: BalanceOf<T>,
},
/// Event emitted when a token transfer occurs.
// Differing style: event name abides by the PSP22 standard.
Transfer {
/// The token.
token: TokenIdOf<T>,
Expand All @@ -158,7 +160,7 @@ pub mod pallet {
value: BalanceOf<T>,
},
/// Event emitted when a token is created.
Create {
Created {
/// The token identifier.
id: TokenIdOf<T>,
/// The creator of the token.
Expand Down Expand Up @@ -379,7 +381,7 @@ pub mod pallet {
T::Lookup::unlookup(admin.clone()),
min_balance,
)?;
Self::deposit_event(Event::Create { id, creator, admin });
Self::deposit_event(Event::Created { id, creator, admin });
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion pallets/api/src/fungibles/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ fn create_works() {
assert!(!Assets::asset_exists(id));
assert_ok!(Fungibles::create(signed(creator), id, admin, 100));
assert!(Assets::asset_exists(id));
System::assert_last_event(Event::Create { id, creator, admin }.into());
System::assert_last_event(Event::Created { id, creator, admin }.into());
// Check error works for `Assets::create()`.
assert_noop!(Fungibles::create(signed(creator), id, admin, 100), AssetsError::InUse);
});
Expand Down
Loading