# Bug on transfer fees in substrate-interface 1.4.2

**URL:** <https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245>\
**Category:** Tikka\
**Tags:** py-polkadot-sdk\
**Created:** [5 January 2023 15:31 UTC](https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245 "2023-01-05T15:31:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vit](https://forum.duniter.org/user_avatar/forum.duniter.org/vit/32/2775_2.png) [@vit](https://forum.duniter.org/u/vit)\
**Post date:** [5 January 2023 15:31 UTC](https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245/1 "2023-01-05T15:31:22Z")

</div>

Tikka 0.6.6 crash if you click on the fees button in the transfer window.

It is a bug in `substrate-interface` last version 1.4.2.

I have opened a new issue:

> <https://github.com/polkascan/py-substrate-interface/issues/309>
>
> Version: 1.4.2
> 
> Requesting fees does not work anymore
> 
> I think it is since i…ssue #277.
> 
> https://github.com/polkascan/py-substrate-interface/blob/a6adde8578f83c3cc057679443d64d0891b15190/substrateinterface/base.py#L2150
> 
> If I skip the new code in \`base.p\`y at line \`2150\` :
> 
> \`\`\`python
> if not self.supports\_rpc\_method('state\_call'):
> \`\`\`
> to run on the old code, everything works fine.
> 
> It seems to be a scale decode error (offset \> length)
> 
> \`\`\`
> DEBUG:substrateinterface.base:Executing Runtime Call TransactionPaymentApi.query\_info
> DEBUG:substrateinterface.base:RPC request #39: "state\_call"
> Traceback (most recent call last):
> File "/home/vit/Documents/dev/python/tikka/tikka/slots/pyqt/entities/worker.py", line 43, in run
> self.call()
> File "/home/vit/Documents/dev/python/tikka/tikka/slots/pyqt/windows/transfer.py", line 291, in fetch\_fees\_from\_network
> self.account, self.recipient\_account.address, blockchain\_value
> File "/home/vit/Documents/dev/python/tikka/tikka/domains/transfers.py", line 55, in fees
> return self.network.fees(sender\_account, recipient\_address, amount)
> File "/home/vit/Documents/dev/python/tikka/tikka/adapters/network/transfers.py", line 111, in fees
> call=call, keypair=sender\_account\_keypair
> File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/substrateinterface/base.py", line 2154, in get\_payment\_info
> result = self.runtime\_call("TransactionPaymentApi", "query\_info", \[extrinsic, extrinsic\_len\])
> File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/substrateinterface/base.py", line 1599, in runtime\_call
> result\_obj.decode(ScaleBytes(result\_data\['result'\]))
> File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/base.py", line 696, in decode
> self.value\_serialized = self.process()
> File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/types.py", line 526, in process
> field\_obj = self.process\_type(data\_type, metadata=self.metadata)
> File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/base.py", line 778, in process\_type
> obj.decode(check\_remaining=False)
> File "/home/vit/Documents/dev/python/tikka/.venv/lib/python3.7/site-packages/scalecodec/base.py", line 712, in decode
> f'Decoding \<{self.\_\_class\_\_.\_\_name\_\_}\> - No more bytes available (needed: {self.data.offset} / total: {self.data.length})'
> scalecodec.exceptions.RemainingScaleBytesNotEmptyException: Decoding \<U128\> - No more bytes available (needed: 25 / total: 17)
> python-BaseException
> \`\`\`
> To help, here is the debug window with the scale value decoded.
> 
> !\[scale\_decode\_error\_on\_fees\](https://user-images.githubusercontent.com/2174016/210815475-821bc9c6-09d6-46f7-bd2a-5326b6e5a904.png)

---

<div class="post-metadata">

**Author:** ![vit](https://forum.duniter.org/user_avatar/forum.duniter.org/vit/32/2775_2.png) [@vit](https://forum.duniter.org/u/vit)\
**Post date:** [6 January 2023 12:52 UTC](https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245/2 "2023-01-06T12:52:48Z")

</div>

@HugoTrentesaux can you take a look at the issue ?

Because it reveals that the Balance Type in Duniter (U64) is different than the substrate default type (U128). Is there a reason for that ?

Substrate does not allow yet to query the custom type automatically so the dev have to handle it manually.

Parity is working on a solution to this problem.

---

<div class="post-metadata">

**Author:** ![tuxmain](https://forum.duniter.org/user_avatar/forum.duniter.org/tuxmain/32/6423_2.png) [@tuxmain](https://forum.duniter.org/u/tuxmain)\
**Post date:** [6 January 2023 12:57 UTC](https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245/3 "2023-01-06T12:57:17Z")

</div>

> [@vit](#):
>
> Because it reveals that the Balance Type in Duniter (U64) is different than the substrate default type (U128). Is there a reason for that ?

Élois thought we didn’t need so much precision (as we have only 2 decimal digits), so he chose to use 64 bits instead of 128 to save storage space.

If needed we can easily switch to u128, but if we want to go back to u64 it may be more complex as it may be lossy.

---

<div class="post-metadata">

**Author:** ![HugoTrentesaux](https://forum.duniter.org/user_avatar/forum.duniter.org/hugotrentesaux/32/6396_2.png) [@HugoTrentesaux](https://forum.duniter.org/u/HugoTrentesaux)\
**Post date:** [6 January 2023 14:42 UTC](https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245/4 "2023-01-06T14:42:21Z")

</div>

I think elois wanted to test the substrate abstraction capabilities. His conclusion is that even substrate is quite easy to customize, this is not the case of the ecosystem around it.

To minimize friction against the ecosystem, I would prefer to stay closer to polkadot. The Duniter `account-data` is a customization of parity balances account-data which only adds the randomId whose utility is still subject to debate ([La solution pour des identicones sécurisées: le random id - #16 by HugoTrentesaux](https://forum.duniter.org/t/la-solution-pour-des-identicones-securisees-le-random-id/9126/16)).

In order to gain grain for transaction fees, I think it would be good to keep a 128 bit account balance. Elois obsession for optimization can be a bit cumbersome.

see also

- [Nombre de décimales et durée maximale sans rotation de base](https://forum.duniter.org/t/nombre-de-decimales-et-duree-maximale-sans-rotation-de-base/9318) (first post)
- [Nombre de décimales et durée maximale sans rotation de base - #8 by elois](https://forum.duniter.org/t/nombre-de-decimales-et-duree-maximale-sans-rotation-de-base/9318/8) (last post)

So I’m adding this to my TODO list: [Je me lance à plein temps (HugoTrentesaux) - #2 by HugoTrentesaux](https://forum.duniter.org/t/je-me-lance-a-plein-temps-hugotrentesaux/9712/2#tmp-3)

---

<div class="post-metadata">

**Author:** ![tuxmain](https://forum.duniter.org/user_avatar/forum.duniter.org/tuxmain/32/6423_2.png) [@tuxmain](https://forum.duniter.org/u/tuxmain)\
**Post date:** [6 January 2023 15:03 UTC](https://forum.duniter.org/t/bug-on-transfer-fees-in-substrate-interface-1-4-2/10245/5 "2023-01-06T15:03:44Z")

</div>

I created [the issue about u128](https://git.duniter.org/nodes/rust/duniter-v2s/-/issues/99), so it’s not only tracked in your forum todo-list.
