F
Flow9mo ago
jordan

jordanschalm (2023-09-05)

After installing flow-cli on a new laptop, I'm having some trouble sending transactions with arguments. The CLI interprets all inputs as containing one more argument than I intend. For example:
// minimal-example-1-arg.cdc
transaction(x: UInt64) {
prepare(signer: AuthAccount) {}
execute {}
}

% flow transactions send ./minimal-example-1-arg.cdc 1 --network canary --signer canary-service
❌ Command Error: error parsing transaction arguments: argument count is 2, expected 1
// minimal-example-1-arg.cdc
transaction(x: UInt64) {
prepare(signer: AuthAccount) {}
execute {}
}

% flow transactions send ./minimal-example-1-arg.cdc 1 --network canary --signer canary-service
❌ Command Error: error parsing transaction arguments: argument count is 2, expected 1
Let me know if anyone has any idea what I'm doing wrong, or if this is a bug.
4 Replies
Needle
Needle9mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title> If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadence
jordan
jordan9mo ago
I'm going off the documented command format: flow transactions send <code filename> [<argument> <argument>...] [flags] from https://developers.flow.com/tooling/flow-cli/transactions/send-transactions. I'm on v1.4.0. I have successfully used this command syntax on a previous installation. Don't recall what version that was unfortunately. Also, the old --args-json flag still works:
% flow transactions send ./minimal-example-1-arg.cdc --network canary --signer canary-service --args-json '[{"type": "UInt64", "value": "2"}]'
% flow transactions send ./minimal-example-1-arg.cdc --network canary --signer canary-service --args-json '[{"type": "UInt64", "value": "2"}]'
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
jordan
jordan9mo ago
Ah makes sense. Thanks!