Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DOBEN committed Jan 29, 2025
1 parent 4e8a7d9 commit 72e8e26
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 7 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions backend-rust/src/graphql_api/baker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ impl Baker {
before,
config.transactions_per_block_connection_limit,
)?;

// Retrieves the transactions related to a baker account ('AddBaker',
// 'RemoveBaker', 'UpdateBakerStake', 'UpdateBakerRestakeEarnings',
// 'UpdateBakerKeys', 'ConfigureBaker'). The transactions are ordered in
Expand Down Expand Up @@ -194,8 +193,7 @@ impl Baker {
FROM transactions
WHERE transactions.sender_index = $5
AND index > $1 AND index < $2
AND type_account IN ('AddBaker', 'RemoveBaker', 'UpdateBakerStake',
'UpdateBakerRestakeEarnings', 'UpdateBakerKeys', 'ConfigureBaker')
AND type_account = ANY($6)
ORDER BY
CASE WHEN NOT $3 THEN index END DESC,
CASE WHEN $3 THEN index END ASC
Expand All @@ -205,7 +203,15 @@ impl Baker {
query.to,
query.desc,
query.limit,
self.id.0
self.id.0,
&[
AccountTransactionType::AddBaker,
AccountTransactionType::RemoveBaker,
AccountTransactionType::UpdateBakerStake,
AccountTransactionType::UpdateBakerRestakeEarnings,
AccountTransactionType::UpdateBakerKeys,
AccountTransactionType::ConfigureBaker
] as &[AccountTransactionType]
)
.fetch(pool);

Expand Down

0 comments on commit 72e8e26

Please sign in to comment.