Skip to content

Commit

Permalink
feat: update to work with new dynamic args (#15)
Browse files Browse the repository at this point in the history
dynamic CLI args under development at stellar/stellar-cli#307
  • Loading branch information
chadoh authored Jan 18, 2023
1 parent 5d5634a commit 6f6f393
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
14 changes: 7 additions & 7 deletions features/dapp_develop/dapp_develop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Given I used cli to compile example contract <ContractExampleSubPath>

Examples:
| Tool | ContractExampleSubPath | ContractName | ContractCompiledFileName |FunctionName | Param1 | Result |
# | JSSDK | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | Aloha | ["Hello","Aloha"] |
| CLI | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | Aloha | ["Hello","Aloha"] |
# | JSSDK | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | --to=Aloha | ["Hello","Aloha"] |
| CLI | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | --to=Aloha | ["Hello","Aloha"] |
# | JSSDK | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 |
| CLI | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 |

Expand All @@ -24,8 +24,8 @@ Scenario Outline: DApp developer compiles, deploys and invokes a contract
Then the result should be <Result>

Examples:
| Tool | ContractExampleSubPath | ContractName | ContractCompiledFileName |FunctionName | Param1 | Result |
# | JSSDK | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | Aloha | ["Hello","Aloha"] |
| CLI | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | Aloha | ["Hello","Aloha"] |
# | JSSDK | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 |
| CLI | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 |
| Tool | ContractExampleSubPath | ContractName | ContractCompiledFileName |FunctionName | Param1 | Result |
# | JSSDK | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | --to=Aloha | ["Hello","Aloha"] |
| CLI | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | --to=Aloha | ["Hello","Aloha"] |
# | JSSDK | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 |
| CLI | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 |
14 changes: 6 additions & 8 deletions features/dapp_develop/dapp_develop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,18 @@ func invokeContractFromCliTool(testConfig *testConfig, functionName string, cont
args := []string{
"contract",
"invoke",
"--id", testConfig.DeployedContractId,
"--rpc-url", testConfig.E2EConfig.TargetNetworkRPCURL,
"--secret-key", testConfig.E2EConfig.TargetNetworkSecretKey,
"--network-passphrase", testConfig.E2EConfig.TargetNetworkPassPhrase,
"--fn",
functionName}
functionName,
"--"}

if param1 != "" {
args = append(args, "--arg")
args = append(args, param1)
}

args = append(args,
"--id", testConfig.DeployedContractId,
"--rpc-url", testConfig.E2EConfig.TargetNetworkRPCURL,
"--secret-key", testConfig.E2EConfig.TargetNetworkSecretKey,
"--network-passphrase", testConfig.E2EConfig.TargetNetworkPassPhrase)

envCmd := cmd.NewCmd("soroban", args...)

status, stdOut, err := e2e.RunCommand(envCmd, testConfig.E2EConfig)
Expand Down

0 comments on commit 6f6f393

Please sign in to comment.