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

script.toBytes() returning empty bytes #1796

Open
v4v2 opened this issue Jan 10, 2025 · 2 comments
Open

script.toBytes() returning empty bytes #1796

v4v2 opened this issue Jan 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@v4v2
Copy link

v4v2 commented Jan 10, 2025

Describe the bug

The toBytes() method of Script is returning empty array on Signet.
I am using a port of BDK to typescript.

To Reproduce

  const inputs = await transaction.input()
  for (const index in inputs) {
      const input = inputs[index]
      const script = await input.scriptSig.toBytes() // THIS IS EMPTY
      input.scriptSig = script
      vin.push(input)
    }
// more ... code

the inputs is an array of TxIn with the fields sequence, previousOutput, witness, but the sigScript which is of type Script is returning empty bytes.

Expected behavior
Get the input script as bytes or hex.

Build environment

  • BDK tag/commit: (how to figure out? I guess it is the latest....)
  • OS+version: ArchLinux latest (using kernel 6.x)
  • Rust/Cargo version: 1.83
  • Rust/Cargo target: x86_64-unknown-linux-gnu

Additional context
Signet

Thanks in advance 👍

@v4v2 v4v2 added the bug Something isn't working label Jan 10, 2025
@v4v2
Copy link
Author

v4v2 commented Jan 10, 2025

if this is indeed a bug and not a misuse from my part, I offer help to fix 👍

@notmandatory
Copy link
Member

You said you're using a port of BDK to typescript, which project is that?

@notmandatory notmandatory added this to BDK Jan 12, 2025
@notmandatory notmandatory moved this to Discussion in BDK Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Discussion
Development

No branches or pull requests

2 participants