Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction.from(buffer: ) always crash #225

Open
kk-vv opened this issue Jan 30, 2024 · 1 comment
Open

Transaction.from(buffer: ) always crash #225

kk-vv opened this issue Jan 30, 2024 · 1 comment

Comments

@kk-vv
Copy link

kk-vv commented Jan 30, 2024

func testTransactionDecode() {
    let swapTransaction = "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAsTL5MjcP0ElSKS7nWnvOk+qZvJ6jITGFotkuy1gKFqIhsLSAdPdbjqMGnJ7T8GvDIZeCrkzY5cnTdJglaxmEudUCHtjI0soEUFAsQ3TdZgefXZpm+TSpDt0GSupo6DANLCL9p3EN7QVm+wCbiCUn2jVyJyazsZQYgqVRhf6h2a/pVY72d/tWNeZHNyS3Dha2QFVANOpHocez/NiIU8QV0yVF04h3XRAtqKdDmTPAd8xoLiu/N2FBWd4n6ilf8Yhj5ycgN6mCDYmBgfgSLDzFZMCMkNJi8513JLWWbMZSdwwSnCib7PSSoSILtrVDwUD5nwX+E/CqiYjJF6S312CKXScwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwZGb+UhFzL/7K26csOb57yM5bvF9xJrLEObOkAAAAAEedVb8jHAbu50xW7OaBUH/bGy3qP0jlECsc2iVrwTjwXQ6k8zc3ATpWPgk0jttvRZPZH8dkH5JHwkQahCobvrBpuIV/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAEG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqTq4kD+3NcqxxnxZr0hX7fYbCvgypQp8WeMhkZ4OyKm8Yahhc3zJAYwffkWR86hkxsihTWzLBM1l7HhE4D472TKMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4WbQ/+if11/ZKdMCbHylYed5LCas238ndUUsyGqezjOXoxvp6877brTo9ZfNqq8l0MbG75MLS9uDkfKYCA0UvXWFmjY92JM6L+n8NG0oowIrwOhILCaj2T4l5EfleAO8P/QcJAAUC2oUCAAkACQPoHwAAAAAAABAGAAUADAgNAQEIAgAFDAIAAACAlpgAAAAAAA0BBQERChYNDgAFBAEHDBIKChEKCw8DDgQBBgINJcEgmzNB1pyBBAEAAAAcAWQAAYCWmAAAAAAA3OYOAAAAAAAyAAANAwUAAAEJ"
    
    let data = Data(base64Encoded: swapTransaction)
    assert(data != nil)
    let transaction = try! Transaction.from(buffer: data!)
    print(transaction)
}
@jonbalbarin
Copy link

Hello:

I’m encountering the same bug - what’s happening is there’s a Fatal error: Range requires lowerBound <= upperBound on this line, for an invalid range (zero to -1)

for j in 0...(instruction.accounts.count - 1) {

There’s an assumption in there that an instruction will have at least one account, and to my understanding this is not actually true. (In my case, I’m working with a transaction that has a “Compute Budget” instruction in it, that has no accounts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants