Skip to content

Commit

Permalink
update system to handle diag events from contract creation/deply and …
Browse files Browse the repository at this point in the history
…cli keys command text changes
  • Loading branch information
sreuland committed Jan 9, 2025
1 parent 8327f56 commit cb8b96a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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

0 comments on commit cb8b96a

Please sign in to comment.