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

system-test: Use --ignore-checks When Deploying & Installing Contracts #83

Merged
merged 1 commit into from
Nov 1, 2023
Merged
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
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
Loading