Skip to content

Conversation

@jim-counter
Copy link
Member

@jim-counter jim-counter commented Sep 26, 2025

Add explicit existential deposit validation functions for consensus and domain chains, replacing generic functions with chain-specific variants.

New Functions

  • meetsConsensusExistentialDepositAi3(amount: string): boolean - Validates AI3 amounts against consensus chain ED (0.00001 AI3)
  • meetsConsensusExistentialDepositShannons(amount: bigint): boolean - Validates Shannon amounts against consensus chain ED
  • meetsDomainExistentialDepositAi3(amount: string): boolean - Validates AI3 amounts against domain/EVM ED (0.000001 AI3)
  • meetsDomainExistentialDepositShannons(amount: bigint): boolean - Validates Shannon amounts against domain/EVM ED

New Constants

  • DEFAULT_CONSENSUS_EXISTENTIAL_DEPOSIT_SHANNONS - 10 trillion Shannons
  • DEFAULT_DOMAIN_EXISTENTIAL_DEPOSIT_SHANNONS - 1 trillion Shannons

Breaking Changes

Removed deprecated generic functions:

  • meetsExistentialDepositAi3 → use meetsConsensusExistentialDepositAi3
  • meetsExistentialDepositShannons → use meetsConsensusExistentialDepositShannons
  • DEFAULT_EXISTENTIAL_DEPOSIT_SHANNONS → use chain-specific constants

Testing

Added comprehensive test coverage (52 tests) with identical validation for both consensus and domain functions.

Addresses reviewer feedback requesting explicit chain-type functions for consensus and domain amount validation.

Copy link
Member

@jfrank-summit jfrank-summit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is needed?

@jim-counter jim-counter changed the title fix(auto-utils): correct existential deposit amount feat(auto-utils): add consensus and domain existential deposit validation functions Sep 30, 2025
Copy link

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Member

@jfrank-summit jfrank-summit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jim-counter jim-counter merged commit f7133cf into main Sep 30, 2025
7 checks passed
@jim-counter jim-counter deleted the fix/correct-existential-deposit-amount branch September 30, 2025 13:47
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.

4 participants