Skip to content

Conversation

@ryanschneider
Copy link
Contributor

Motivation

After learning about mktx (see #8472 😅) I wanted to use it to create a blob tx, but received this error:

error: unexpected argument '--path' found

Or this error w/o --path:

Error:
server returned an error response: error code -32003: blob transaction missing blob hashes

Solution

I replicated the same missing logic from send in mktx. I also fixed the --path help showing up under Wallet options on both commands. I also considered moving path into TransactionOpts but that's used in enough other spots I assumed there was a good reason it wasn't there already.

Anyways, it works now:

> cargo run --bin cast -- mktx --private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --blob --path <(echo "hello") | wc -c
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.79s
     Running `target/debug/cast mktx --private-key 0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 --blob --path /dev/fd/11`
  262647

@mattsse mattsse enabled auto-merge (squash) July 20, 2024 07:54
@mattsse mattsse merged commit 1bae886 into foundry-rs:master Jul 20, 2024
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

Successfully merging this pull request may close these issues.

3 participants