onflow / flow-cli

The Flow CLI is a command-line interface that provides useful utilities for building Flow applications
https://onflow.org
Apache License 2.0
206 stars 62 forks source link

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

Open sisyphusSmiling opened 9 months ago

sisyphusSmiling commented 9 months ago

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

bjartek commented 9 months ago

This has been fixed in head i belive

sisyphusSmiling commented 9 months ago

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

turbolent commented 9 months ago

@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?

bjartek commented 9 months ago

I took a stab at this @turbolent @SupunS

SupunS commented 9 months ago

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.