novasamatech / substrate-sdk-android

Native Android SDK for developing client apps for Substrate-based networks
https://novawallet.io
Apache License 2.0
12 stars 7 forks source link

Fix/stack overflow #97

Open valentunn opened 5 days ago

valentunn commented 5 days ago

Sequence of steps to reproduce:

  1. Add 2 calls to extrinsics
  2. Retrive call via getCall() - ExtrinsicBuilder returns batch
  3. Add returned batch back to extrinsic builder

Since batch parameter contains the same list that is later modified to add this batch back, batch ended up being added to itself To solve this, we should always return a new copy of call list when using getWrappedCall() and getCalls()