Skip to content

Commit

Permalink
Removed pocketnetteam from events and activities
Browse files Browse the repository at this point in the history
  • Loading branch information
lostystyg committed Aug 24, 2022
1 parent 876e7b5 commit fcb2fed
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
54 changes: 0 additions & 54 deletions src/pocketdb/repositories/web/WebRpcRepository.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4789,7 +4789,6 @@ namespace PocketDb
const int64_t& blockNumMax;
} queryParams{address, heightMax, heightMin, blockNumMax};

// Pocketnetteam and referal txs are ignored
static const std::map<ShortTxType, ShortFormSqlEntry<std::shared_ptr<sqlite3_stmt*>&, QueryParams>> selects = {
{
ShortTxType::Answer, { R"sql(
Expand Down Expand Up @@ -5770,60 +5769,7 @@ namespace PocketDb
const int64_t& blockNumMax;
} queryParams {address, heightMax, heightMin, blockNumMax};

// Static because it will not be changed for entire node run
static const auto pocketnetteamAddresses = GetPocketnetteamAddresses();

static const std::map<ShortTxType, ShortFormSqlEntry<std::shared_ptr<sqlite3_stmt*>&, QueryParams>> selects = {
{
ShortTxType::PocketnetTeam, { R"sql(
-- Pocket posts
select
(')sql" + ShortTxTypeConvertor::toString(ShortTxType::PocketnetTeam) + R"sql(')TP,
t.Hash,
t.Type,
null,
t.Height as Height,
t.BlockNum as BlockNum,
null, -- Address, not required here because we already know it
p.String2, -- Caption
null,
null,
null,
null,
null, -- TODO (losty): related content? If repost etc
null,
null,
null,
null,
null,
null,
null,
null,
null,
null
from Transactions t indexed by Transactions_Type_Last_String1_Height_Id
left join Payload p
on p.TxHash = t.Hash
where t.Type in (200,201,202)
and t.String1 in ( )sql" + join(vector<string>(pocketnetteamAddresses.size(), "?"), ",") + R"sql( )
and t.Last = 1
and t.Height > ?
and (t.Height < ? or (t.Height = ? and t.BlockNum < ?))
)sql",
[this](std::shared_ptr<sqlite3_stmt*>& stmt, int& i, QueryParams const& queryParams) {
for(const auto& pocketnetteamAddress: pocketnetteamAddresses) {
TryBindStatementText(stmt, i++, pocketnetteamAddress);
}
TryBindStatementInt64(stmt, i++, queryParams.heightMin);
TryBindStatementInt64(stmt, i++, queryParams.heightMax);
TryBindStatementInt64(stmt, i++, queryParams.heightMax);
TryBindStatementInt64(stmt, i++, queryParams.blockNumMax);
}
}},

{
ShortTxType::Money, { R"sql(
-- Incoming money
Expand Down
2 changes: 0 additions & 2 deletions src/pocketdb/web/PocketContentRpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,6 @@ namespace PocketWeb::PocketWebRpc
{"blockNum", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "number of transaction in block to start search from for specified heightMax, excluding. Default is 999999"},
{"filters", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "filters to specify event's types to search for. Default: search for all events",
{
{ShortTxTypeConvertor::toString(ShortTxType::PocketnetTeam), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "posts from pocketnet team acc"},
{ShortTxTypeConvertor::toString(ShortTxType::Money), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "incoming money"},
{ShortTxTypeConvertor::toString(ShortTxType::Referal), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "registered referals"},
{ShortTxTypeConvertor::toString(ShortTxType::Answer), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "answers to acc's comments"},
Expand Down Expand Up @@ -1470,7 +1469,6 @@ namespace PocketWeb::PocketWebRpc
{"blockNum", RPCArg::Type::NUM, RPCArg::Optional::OMITTED_NAMED_ARG, "number of transaction in block to start search from for specified heightMax, excluding. Default is 999999"},
{"filters", RPCArg::Type::ARR, RPCArg::Optional::OMITTED_NAMED_ARG, "filters to specify event's types to search for. Default: search for all activities",
{
{ShortTxTypeConvertor::toString(ShortTxType::Money), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "money sended by acc"},
{ShortTxTypeConvertor::toString(ShortTxType::Answer), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "acc's answers to comments"},
{ShortTxTypeConvertor::toString(ShortTxType::Comment), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "acc's comments"},
{ShortTxTypeConvertor::toString(ShortTxType::Subscriber), RPCArg::Type::STR, RPCArg::Optional::OMITTED_NAMED_ARG, "acc's subscribes"},
Expand Down

0 comments on commit fcb2fed

Please sign in to comment.