Closed aarmoa closed 4 months ago
The recent updates primarily enhance token management across various components. Major changes include integrating a TokenMetadata
interface, adding URLs for token lists in different environments, and modifying unit tests to use mock data. These improvements streamline token representation and loading, ensuring consistency and flexibility in handling token information across the client.
Files | Change Summaries |
---|---|
client/chain/chain_test.go |
Set Keyring field to nil to prevent account initialization during unit tests. |
client/chain/markets_assistant.go |
Added TokenMetadata interface and consolidated token representation functions. |
client/chain/markets_assistant_test.go |
Added imports, mock HTTP server setup, and network object initialization for testing. |
client/common/network.go |
Added URLs for token lists and updated Network struct with OfficialTokensListUrl field. |
client/core/tokens_file_loader.go |
Introduced functionality to load token metadata from a specified file URL. |
client/core/tokens_file_loader_test.go |
Added test functions for loading tokens and handling errors during token loading. |
client/exchange/exchange.go |
Added GetNetwork() method to ExchangeClient interface and its implementation. |
client/exchange/exchange_test_support.go |
Added Network field and GetNetwork() method to MockExchangeClient struct. |
sequenceDiagram
participant User
participant MarketsAssistant
participant TokenMetadata
participant Network
participant ExchangeClient
User->>MarketsAssistant: Request token representation
MarketsAssistant->>TokenMetadata: Fetch token details
TokenMetadata-->>MarketsAssistant: Provide token information
MarketsAssistant-->>User: Return token representation
User->>ExchangeClient: Request network information
ExchangeClient->>Network: Fetch network details
Network-->>ExchangeClient: Provide token list URL
ExchangeClient-->>User: Return network information
In the world of tokens, changes flow, Metadata now, a unified show. URLs for lists on every net, Mock tests ensure no bugs are met. Tokens load with seamless grace, In Injective's ever-evolving space. 🌟
Solves CHAIN-101
Summary by CodeRabbit
New Features
TokenMetadata
interface for retrieving token information.Bug Fixes
Keyring
tonil
.Tests
Enhancements
TokenMetadata
interface.ExchangeClient
to include a method for retrieving network information.