We are porting LCS to javascript. Deserialization is working but we have a problem with creating the signed transaction for a transaction. All seems fine but when we submit the transaction request we get a major status 11 error. Although all seems fine, we get this error which translates to UNKNOWN_SCRIPT and this has probably to do with a whitelist check.
We are creating the uint8Array for the signed transaction in this way:
writeU32(senderAdrresLength) // 32
writeBytes(senderAddress)
writeU64(sequenceNumber)
writeU32(payloadType) // 2 for program
writePeerToPeerHash() //constant
writeNumberOfArgumentsForProgram() // 2
writeArgumentType() // 0 for amount
writeU64(amount)
writeArgumentType() // 1 for address
writeU32(receiverAddressLength) // 32
writeBytes(receiverAddress)
writeU32(0) // no modules so length 0
writeU64(1000000) // maxGasAmount
writeU64(0) // gasUnitPrice
writeU64(expirationTime)
Now we have a RawTransaction and we create a public key and we create a signature from this transaction. These we add to the Uint8Array.
writeU32(publicKeyCount)
writeBytes(publicKey)
writeU32(signatureCount)
writeBytes(signature)
The generated Uint8Array is a signed transaction which we set in the proto SignedTransaction. Now we submit it for transfer. All seems fine as the signature is correct and when we change gas settings we can get the response that the gaslimit is to low. As said we are currently stuck at the majorStatus 11 error.
We have checked everything but we do not know what is causing this error. We are using the creatInsecure() setting for the grpc connection, but that used to work fine. I hope someone can shed a light on thing.
Cheers