Skip to content

Commit 5d5fd32

Browse files
committed
Unused events have not been required for a long time
1 parent 32ed561 commit 5d5fd32

7 files changed

Lines changed: 1 addition & 18 deletions

File tree

doc/src/development/services/cpp-service/reference/services-events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ auto result =
6666

6767
## Defining events
6868

69-
To define events for a service, declare the event functions as below, then reflect them using the 2 macros below. Each of the `History` and `Merkle` structs must be present and reflected, even when they don't have any events declared within.
69+
To define events for a service, declare the event functions as below, then reflect them using the 2 macros below.
7070

7171
After you have defined your events, use [psibase::Service::emit] to emit them and [psibase::Service::events] to read them.
7272

packages/system/Transact/include/services/system/Transact.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,6 @@ namespace SystemService
498498
/// Emitted at the start of each block
499499
void blockStart(psibase::BlockNum blockNum, psibase::BlockTime blockTime) {}
500500
};
501-
struct Merkle
502-
{
503-
};
504501
};
505502
};
506503
PSIO_REFLECT(Transact,
@@ -533,7 +530,6 @@ namespace SystemService
533530
PSIBASE_REFLECT_TABLES(Transact, Transact::Tables)
534531
PSIBASE_REFLECT_HISTORY_EVENTS(Transact, method(blockStart, blockNum, blockTime));
535532
PSIBASE_PUBLIC_EVENT(Transact::Events::History::blockStart)
536-
PSIBASE_REFLECT_MERKLE_EVENTS(Transact);
537533

538534
// The status will never be nullopt during transaction execution or during RPC.
539535
// It will be nullopt when called by a test wasm before the genesis transaction

packages/user/Chainmail/include/services/user/Chainmail.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ namespace UserService
4444
void sent(psibase::AccountNumber sender, psibase::AccountNumber receiver, std::string subject, std::string body, psibase::TimePointSec datetime) {}
4545
void archive(std::string msg_id) {}
4646
};
47-
struct Merkle{};
4847
};
4948
// clang-format on
5049
};
@@ -62,7 +61,6 @@ namespace UserService
6261
method(sent, sender, receiver, subject, body, datetime),
6362
method(archive, msg_id),
6463
);
65-
PSIBASE_REFLECT_MERKLE_EVENTS(Chainmail);
6664
// clang-format on
6765

6866
} // namespace UserService

packages/user/Events/test/TestService.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ struct TestService : psibase::Service
2323
void account(psibase::AccountNumber a);
2424
void time(psibase::TimePointSec t);
2525
};
26-
struct Merkle
27-
{
28-
};
2926
};
3027
};
3128
PSIO_REFLECT(TestService,
@@ -43,6 +40,5 @@ PSIBASE_REFLECT_HISTORY_EVENTS(TestService,
4340
method(str, s),
4441
method(account, a),
4542
method(time, t));
46-
PSIBASE_REFLECT_MERKLE_EVENTS(TestService);
4743

4844
PSIBASE_REFLECT_TABLES(TestService)

packages/user/Invite/include/services/user/Invite.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ namespace UserService
102102
{
103103
void updated(uint32_t inviteId, psibase::AccountNumber actor, std::string_view event);
104104
};
105-
struct Merkle {};
106105
};
107106
// clang-format on
108107
};
@@ -121,7 +120,6 @@ namespace UserService
121120
PSIBASE_REFLECT_HISTORY_EVENTS(Invite,
122121
method(updated, inviteId, actor, event),
123122
);
124-
PSIBASE_REFLECT_MERKLE_EVENTS(Invite);
125123
PSIBASE_REFLECT_TABLES(Invite, Invite::Tables)
126124
// clang-format on
127125
} // namespace InviteNs

packages/user/Symbol/include/services/user/Symbol.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ namespace UserService
4949
{
5050
void symEvent(SID symbol, Account actor, uint8_t action) {}
5151
};
52-
struct Merkle{};
5352
};
5453
// clang-format on
5554
};
@@ -73,7 +72,6 @@ namespace UserService
7372
PSIBASE_REFLECT_HISTORY_EVENTS(Symbol,
7473
method(symEvent, symbol, actor, action),
7574
);
76-
PSIBASE_REFLECT_MERKLE_EVENTS(Symbol);
7775

7876
PSIBASE_REFLECT_TABLES(Symbol, Symbol::Tables)
7977
// clang-format on

packages/user/Tokens/include/services/user/Tokens.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,6 @@ namespace UserService
361361
void supplyChanged(TID tokenId, Account actor, std::string action, std::string amount, Memo memo) {}
362362
void balChanged(TID tokenId, Account account, Account counterParty, std::string action, std::string amount, Memo memo) {}
363363
};
364-
365-
struct Merkle{};
366364
};
367365
// clang-format on
368366
};
@@ -401,7 +399,6 @@ namespace UserService
401399
method(supplyChanged, tokenId, actor, action, amount, memo),
402400
method(balChanged, tokenId, account, counterParty, action, amount, memo),
403401
);
404-
PSIBASE_REFLECT_MERKLE_EVENTS(Tokens);
405402
PSIBASE_REFLECT_TABLES(Tokens, Tokens::Tables)
406403
// clang-format on
407404

0 commit comments

Comments
 (0)