Skip to content

[BCN] fix gnosis token history casing gap and return 400 for invalid ethmultisig addresses#4199

Open
msalcala11 wants to merge 1 commit into
bitpay:masterfrom
msalcala11:evm-token-history-followups
Open

[BCN] fix gnosis token history casing gap and return 400 for invalid ethmultisig addresses#4199
msalcala11 wants to merge 1 commit into
bitpay:masterfrom
msalcala11:evm-token-history-followups

Conversation

@msalcala11

Copy link
Copy Markdown
Contributor

Description

Two fixes for Gnosis multisig token history:

  1. The transaction query matches effects.* addresses case-sensitively against checksummed values, but effect addresses weren't checksummed at ingestion until 1df6336, and effects.* was never backfilled (fixEvmTxToFromAddressesCase.js only rewrites top-level to/from). Docs synced before then store lowercase effect addresses, so the query silently drops them before the case-insensitive matching from #4186 can see them. The query now accepts both casings.
  2. Since [BCN] Filter failed EVM token history rows #4186, a malformed request address makes toChecksumAddress throw and the endpoint returns a 500 (previously an empty 200). It now returns a 400.

Changelog

  • Match both casings for effects.contractAddress, effects.from, and effects.to in the Gnosis transaction query via $in (still uses the existing indexes).
  • Return a 400 for invalid addresses on /ethmultisig/transactions/:multisigContractAddress, validating with the same validation logic as toChecksumAddress.
  • Update the Gnosis unit test query assertions to match.

Testing Notes

  • cd packages/bitcore-node && npm run test:unit — the "EVM token wallet history filtering" suite covers both the query shape and row emission. On Node below 22.12, run with NODE_OPTIONS=--experimental-require-module.
  • GET /api/ETH/mainnet/ethmultisig/transactions/notanaddress returns 400 (previously 500); valid addresses in either casing stream normally.

Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.

@msalcala11 msalcala11 force-pushed the evm-token-history-followups branch from 8fdf01c to 331cb7e Compare July 14, 2026 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant