Skip to content

Commit

Permalink
Merge pull request #83 from stellar/cli-warning
Browse files Browse the repository at this point in the history
system-test: Use --ignore-checks When Deploying & Installing Contracts
  • Loading branch information
stellarsaur committed Nov 1, 2023
2 parents 3fd3ba4 + 9e3dcce commit a16998b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions features/dapp_develop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,25 @@ func compileContract(contractExamplesSubPath string, contractWorkingDirectory st
func deployContract(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, installedContractId string, e2eConfig *e2e.E2EConfig) (string, error) {
var envCmd *cmd.Cmd

// Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK.
if installedContractId != "" {
envCmd = cmd.NewCmd("soroban",
"contract",
"deploy",
"--wasm-hash", installedContractId,
"--rpc-url", e2eConfig.TargetNetworkRPCURL,
"--source", e2eConfig.TargetNetworkSecretKey,
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase)
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase,
"--ignore-checks")
} else {
envCmd = cmd.NewCmd("soroban",
"contract",
"deploy",
"--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName),
"--rpc-url", e2eConfig.TargetNetworkRPCURL,
"--source", e2eConfig.TargetNetworkSecretKey,
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase)
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase,
"--ignore-checks")
}

status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig)
Expand All @@ -74,12 +77,14 @@ func deployContract(compiledContractFileName string, contractWorkingDirectory st
}

func deployContractUsingConfigParams(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, identityName string, networkConfigName string, e2eConfig *e2e.E2EConfig) (string, error) {
// Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK.
envCmd := cmd.NewCmd("soroban",
"contract",
"deploy",
"--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName),
"--network", networkConfigName,
"--source", identityName)
"--source", identityName,
"--ignore-checks")

status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig)

Expand All @@ -96,13 +101,15 @@ func deployContractUsingConfigParams(compiledContractFileName string, contractWo

// returns the installed contract id
func installContract(compiledContractFileName string, contractWorkingDirectory string, contractExamplesSubPath string, e2eConfig *e2e.E2EConfig) (string, error) {
// Always use --ignore-checks since system-test will use contracts compiled with RC versions of the Soroban Rust SDK.
envCmd := cmd.NewCmd("soroban",
"contract",
"install",
"--wasm", fmt.Sprintf("./%s/%s/target/wasm32-unknown-unknown/release/%s", contractWorkingDirectory, contractExamplesSubPath, compiledContractFileName),
"--rpc-url", e2eConfig.TargetNetworkRPCURL,
"--source", e2eConfig.TargetNetworkSecretKey,
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase)
"--network-passphrase", e2eConfig.TargetNetworkPassPhrase,
"--ignore-checks")

status, stdOut, err := e2e.RunCommand(envCmd, e2eConfig)

Expand Down

0 comments on commit a16998b

Please sign in to comment.