flow-cli icon indicating copy to clipboard operation
flow-cli copied to clipboard

[BUG] Extra argument passed to transactions in Stable Cadence Pre-release version

Open sisyphusSmiling opened this issue 1 year ago • 5 comments

Problem

When trying to send a transaction with parameters, I consistently get

❌ Command Error: error parsing transaction arguments: argument count is [n+1], expected [n]

Steps to Reproduce

With the Stable Cadence CLI preview release installed, try the following transaction:

transaction(s: String) {
    prepare(signer: &Account) {
        log(s)
    }
}
flow transactions send ./transactions/test_param.cdc hello

And it should output:

❌ Command Error: error parsing transaction arguments: argument count is 2, expected 1

Confirm it works without the transaction parameter:

transaction {
    prepare(signer: &Account) {
        log("hello")
    }
}
flow transactions send ./transactions/test.cdc

And it should succeed.

Acceptance Criteria

Transactions with and without params should execute.

Context

Using the preview release to update FLIPs and contracts.

Machine Info

OS: macOS 13.6 (22G120) CLI: v1.5.0-stable-cadence.2

sisyphusSmiling avatar Sep 21 '23 23:09 sisyphusSmiling

This has been fixed in head i belive

bjartek avatar Sep 22 '23 20:09 bjartek

Just tried with fresh install of v1.5.0-stable-cadence.2 and still experiencing the issue.

sisyphusSmiling avatar Sep 22 '23 21:09 sisyphusSmiling

@SupunS Is it possible that the latest Stable Cadence release, v1.5.0-stable-cadence.2, does not yet have the Flow CLI master code which includes #1179 and #1182? Could you please merge master into the Stable Cadence feature branch and create a new preview build?

turbolent avatar Sep 26 '23 00:09 turbolent

I took a stab at this @turbolent @SupunS

bjartek avatar Sep 26 '23 07:09 bjartek

Merging the master seems to fix it.

Would be good to have some test cases around this. Didn't see any test in the above two PRs (#1179 and #1182) either.

SupunS avatar Sep 26 '23 15:09 SupunS