Skip to content

Commit 78ebad0

Browse files
authored
fix(rosetta): get current block should only join by stacks chain tip information (#2265)
* test: log balance error * test: json fix * fix: try block wait * test: wait block * test: more wait * fix: wait full cycle * fix: del aggr * fix: wait construction * fix: remove block hash expectation * fix: get current block * fix: revert some * fix: try reverting all
1 parent 3d33725 commit 78ebad0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/datastore/pg-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export class PgStore extends BasePgStore {
383383
const result = await sql<BlockQueryResult[]>`
384384
SELECT ${sql(BLOCK_COLUMNS.map(c => `b.${c}`))}
385385
FROM blocks b
386-
INNER JOIN chain_tip t USING (index_block_hash, block_hash, block_height, burn_block_height)
386+
INNER JOIN chain_tip t USING (index_block_hash, block_hash, block_height)
387387
LIMIT 1
388388
`;
389389
if (result.length === 0) {

tests/utils/test-helpers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ export async function getRosettaAccountBalance(stacksAddress: string, atBlockHei
494494
req
495495
);
496496
// Also query for locked balance, requires specifying a special constant sub_account
497+
req.block_identifier = { hash: account.block_identifier.hash };
497498
req.account_identifier.sub_account = { address: RosettaConstants.StackedBalance };
498499
const locked = await fetchRosetta<RosettaAccountBalanceRequest, RosettaAccountBalanceResponse>(
499500
'/rosetta/v1/account/balance',

0 commit comments

Comments
 (0)