parsing non-standard group output script throw IndexOutOfBoundsException
this tx for example: https://explorer.nexa.org/tx/eafde0ba6d603aaca88615b392c810a558911bd54cab217d35db080bad2879fa
if libnexakotlin try to do txOut.groupInfo() on the first output, it fail with this exeption:
java.lang.IndexOutOfBoundsException: toIndex (103) is greater than size (102).
at kotlin.collections.ArraysKt__ArraysJVMKt.copyOfRangeToIndexCheck(ArraysJVM.kt:49) ~[kotlin-stdlib-1.9.25.jar:1.9.25-release-852]
at kotlin.collections.ArraysKt___ArraysJvmKt.copyOfRange(_ArraysJvm.kt:1465) ~[kotlin-stdlib-1.9.25.jar:1.9.25-release-852]
at kotlin.collections.ArraysKt___ArraysKt.sliceArray(_Arrays.kt:4701) ~[kotlin-stdlib-1.9.25.jar:1.9.25-release-852]
at org.nexa.libnexakotlin.ScriptKt.tokenizeScriptBin(script.kt:1235) ~[libnexakotlin-jvm-0.4.23.jar:na]
at org.nexa.libnexakotlin.SatoshiScript.parsed(script.kt:1470) ~[libnexakotlin-jvm-0.4.23.jar:na]
at org.nexa.libnexakotlin.SatoshiScript.groupInfo(script.kt:1911) ~[libnexakotlin-jvm-0.4.23.jar:na]
at org.nexa.libnexakotlin.iTxOutput$DefaultImpls.groupInfo(ichain.kt:193) ~[libnexakotlin-jvm-0.4.23.jar:na]
at org.nexa.libnexakotlin.NexaTxOutput.groupInfo(nexaTransaction.kt:249) ~[libnexakotlin-jvm-0.4.23.jar:na]
at ...
this is because the script is kind of 'broken' and in tokenizeScriptBin(script.kt:1235) it tries to parse an empty pushdata1..
well, although the script is broken, this output still hold nex and tokens to some group and address, so this info is still needed. rostrum and explorer show the details correctly, but cannot be parsed in libnexakotlin.
since people can put almost any scripts in output, even broken ones, as long as the tx is valid we should still be able to follow the script template pattern of <groupId><groupAmount><templateHash><argsHash><visibleArgs>
and extract group info + dest address.
this also make toString of the tx / output to fail.