-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
Describe the bug
When looking up inj in self.tokens, the SDK resolves it to an IBC asset instead of the native INJ token. This causes unexpected behavior when constructing messages (e.g., MsgSend) if inj is passed instead of INJ.
Steps to Reproduce
from pyinjective.core.composer import Composer
# Assume latest pyinjective SDK + token registry loaded
composer = Composer(network="mainnet", tokens=load_tokens()) # load_tokens is whatever registry loader
print("self.tokens['inj']")
print(composer.tokens["inj"])
print("self.tokens['INJ']")
print(composer.tokens["INJ"])Outputs
self.tokens['inj']
Token(name='Unknown', symbol='inj', denom='ibc/052AF4B0650990067B8FC5345A39206497BCC12F0ABE94F15415413739B93B26', address='ibc/052AF4B0650990067B8FC5345A39206497BCC12F0ABE94F15415413739B93B26', decimals=0, logo='https://imagedelivery.net/lPzngbR8EltRfBOi_WYaXw/63a231c0-d1c3-4901-1e28-7c4410dfaa00/public', updated=-1)
self.tokens['INJ']
Token(name='Injective', symbol='INJ', denom='inj', address='inj', decimals=18, logo='https://imagedelivery.net/lPzngbR8EltRfBOi_WYaXw/7123d071-0def-459a-16b9-d85e8ea04700/public', updated=-1)Example:
msg = composer.MsgSend(
from_address=address.to_acc_bech32(),
to_address=address.to_acc_bech32(),
amount="0.1", # 0.1 INJ
denom="INJ"
)vs
msg = composer.MsgSend(
from_address=address.to_acc_bech32(),
to_address=address.to_acc_bech32(),
amount="0.1", # 0.1 INJ
denom="inj"
)Environment
Running on the latest sdk -> 1.10.0
Metadata
Metadata
Assignees
Labels
No labels