Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update system to handle latest behviors #115

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion features/dapp_develop/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dapp_develop
import (
"encoding/json"
"fmt"
"regexp"
"strings"

"github.com/go-cmd/cmd"
Expand Down Expand Up @@ -99,7 +100,8 @@ func getEventsFromCliTool(ledgerFrom uint32, deployedContractId string, size uin
}

// put commas between any json event objects if more than one found
stdOutEventsValidJson := strings.ReplaceAll(strings.Join(stdOutLines, "\n"), `\n}\n{\n`, `\n}\n,\n{\n`)
regex := regexp.MustCompile(`\n}\n{\n`) // Create a regex pattern
stdOutEventsValidJson := regex.ReplaceAllString(strings.Join(stdOutLines, "\n"), "\n}\n,\n{\n")
// wrap the json objects in json array brackets
stdOutEventsValidJson = "[" + stdOutEventsValidJson + "]"

Expand Down
8 changes: 4 additions & 4 deletions features/dapp_develop/dapp_develop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Scenario Outline: DApp developer compiles, deploys and invokes a contract

Examples:
| Tool | ContractExampleSubPath | ContractName | ContractCompiledFileName | FunctionName | FunctionParams | Result | EventCount | DiagEventCount |
| NODEJS | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | to:Aloha | ["Hello","Aloha"] | 0 | 1 |
| CLI | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | --to=Aloha | ["Hello","Aloha"] | 0 | 1 |
| NODEJS | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 | 0 | 1 |
| CLI | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 | 0 | 1 |
| NODEJS | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | to:Aloha | ["Hello","Aloha"] | 0 | 2 |
| CLI | hello_world | soroban-hello-world-contract | soroban_hello_world_contract.wasm | hello | --to=Aloha | ["Hello","Aloha"] | 0 | 2 |
| NODEJS | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 | 0 | 2 |
| CLI | increment | soroban-increment-contract | soroban_increment_contract.wasm | increment | | 1 | 0 | 2 |


Scenario Outline: DApp developer uses config states, compiles, deploys and invokes contract with authorizations
Expand Down
2 changes: 1 addition & 1 deletion features/dapp_develop/soroban_config.exp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ set KEY_NAME [lindex $argv 0]
set KEY [lindex $argv 1]
set timeout -1
spawn soroban keys add --secret-key $KEY_NAME
expect -exact "Type a secret key: \r"
expect "Type a secret key"
send -- "$KEY\r"
expect eof
Loading