Skip to content

Async Get_balances at a specific block returns current block #3038

@RD4Fun

Description

@RD4Fun

Describe the bug

subtensor.get_balance(mycoldkey, block=block) returns a different value to subtensor.get_balances(*(mycoldkey), block=block)

To Reproduce

run this snippet the values should be the same

import asyncio
from bittensor.core.async_subtensor import AsyncSubtensor

# block and coldkey we are interested in

mycoldkey = '5F6a4sLjgH6B3wfioD2s2xvv64UcFUcrK3UVAHzfNLYNiT4R'
mysubtensor = 'wss://archive.minersunion.ai'
async def main():
    async with AsyncSubtensor(mysubtensor) as subtensor:
        myaddresses=[mycoldkey]
        block = 6309620 
        balance_data_block = await subtensor.get_balance(mycoldkey, block=block)
        print(f'balance_data_block: {balance_data_block}')
        balanceS_data_block = await subtensor.get_balances(*(myaddresses), block=block)
        print(f'balanceS_data_block: {balanceS_data_block[mycoldkey]}')

if __name__ == "__main__":
    asyncio.run(main())

Expected behavior

Both calls should return the same value

Screenshots

No response

Environment

bittensor 9.10.0

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions