-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dependabot/go_modules/github.com/CosmWasm/wa…
…smvm/v2-2.1.5
- Loading branch information
Showing
16 changed files
with
370 additions
and
89 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
.changelog/unreleased/bug-fixes/3490-export-consensus-validators.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- Export only validators that are participating in consensus | ||
([\#3490](https://github.com/cosmos/gaia/pull/3490)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
# CODEOWNERS: https://help.github.com/articles/about-codeowners/ | ||
|
||
# Primary repo maintainers | ||
* @cosmos/informal_gaia_maintain @cosmos/interchain_inc_gaia_write | ||
|
||
# CODEOWNERS for the CODEOWNER file | ||
|
||
/.github/CODEOWNERS @cosmos/informal_gaia_maintain | ||
* @cosmos/interchain_inc_gaia_write | ||
|
||
# CODEOWNERS for interchain tests | ||
|
||
/tests/interchain @dasanchez @LexaMichaelides @fastfadingviolets @cosmos/informal_gaia_maintain @cosmos/interchain_inc_gaia_write | ||
/tests/interchain @dasanchez @LexaMichaelides @fastfadingviolets @cosmos/interchain_inc_gaia_write |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: gaurav-nelson/[email protected].15 | ||
- uses: gaurav-nelson/[email protected].16 | ||
with: | ||
folder-path: "docs" | ||
file-extension: ".mdx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
package e2e | ||
|
||
import ( | ||
"context" | ||
"encoding/base64" | ||
"encoding/json" | ||
"fmt" | ||
"os" | ||
"path/filepath" | ||
"time" | ||
|
||
"github.com/cosmos/cosmos-sdk/client/flags" | ||
) | ||
|
||
func (s *IntegrationTestSuite) testCWCounter() { | ||
ctx, cancel := context.WithTimeout(context.Background(), time.Minute) | ||
defer cancel() | ||
valIdx := 0 | ||
val := s.chainA.validators[valIdx] | ||
address, _ := val.keyInfo.GetAddress() | ||
sender := address.String() | ||
dirName, err := os.Getwd() | ||
s.Require().NoError(err) | ||
|
||
// Copy file to container path and store the contract | ||
src := filepath.Join(dirName, "data/counter.wasm") | ||
dst := filepath.Join(val.configDir(), "config", "counter.wasm") | ||
_, err = copyFile(src, dst) | ||
s.Require().NoError(err) | ||
storeWasmPath := configFile("counter.wasm") | ||
s.storeWasm(ctx, s.chainA, valIdx, sender, storeWasmPath) | ||
|
||
// Instantiate the contract | ||
s.instantiateWasm(ctx, s.chainA, valIdx, sender, "1", "{\"count\":0}", "counter") | ||
chainEndpoint := fmt.Sprintf("http://%s", s.valResources[s.chainA.id][0].GetHostPort("1317/tcp")) | ||
contractAddr, err := queryWasmContractAddress(chainEndpoint, address.String()) | ||
s.Require().NoError(err) | ||
|
||
// Execute the contract | ||
s.executeWasm(ctx, s.chainA, valIdx, sender, contractAddr, "{\"increment\":{}}") | ||
|
||
// Validate count increment | ||
query := map[string]interface{}{ | ||
"get_count": map[string]interface{}{}, | ||
} | ||
queryJSON, err := json.Marshal(query) | ||
s.Require().NoError(err) | ||
queryMsg := base64.StdEncoding.EncodeToString(queryJSON) | ||
data, err := queryWasmSmartContractState(chainEndpoint, contractAddr, queryMsg) | ||
s.Require().NoError(err) | ||
var counterResp map[string]int | ||
err = json.Unmarshal(data, &counterResp) | ||
s.Require().NoError(err) | ||
s.Require().Equal(1, counterResp["count"]) | ||
} | ||
|
||
func (s *IntegrationTestSuite) storeWasm(ctx context.Context, c *chain, valIdx int, sender, wasmPath string) { | ||
storeCmd := []string{ | ||
gaiadBinary, | ||
txCommand, | ||
"wasm", | ||
"store", | ||
wasmPath, | ||
fmt.Sprintf("--from=%s", sender), | ||
fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), | ||
fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), | ||
"--gas=2000000", | ||
"--keyring-backend=test", | ||
"--broadcast-mode=sync", | ||
"--output=json", | ||
"-y", | ||
} | ||
|
||
s.T().Logf("%s storing wasm on host chain %s", sender, s.chainB.id) | ||
s.executeGaiaTxCommand(ctx, c, storeCmd, valIdx, s.defaultExecValidation(c, valIdx)) | ||
s.T().Log("successfully sent store wasm tx") | ||
} | ||
|
||
func (s *IntegrationTestSuite) instantiateWasm(ctx context.Context, c *chain, valIdx int, sender, codeID, | ||
msg, label string, | ||
) { | ||
storeCmd := []string{ | ||
gaiadBinary, | ||
txCommand, | ||
"wasm", | ||
"instantiate", | ||
codeID, | ||
msg, | ||
fmt.Sprintf("--from=%s", sender), | ||
fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), | ||
fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), | ||
fmt.Sprintf("--label=%s", label), | ||
"--no-admin", | ||
"--gas=250000", | ||
"--keyring-backend=test", | ||
"--broadcast-mode=sync", | ||
"--output=json", | ||
"-y", | ||
} | ||
|
||
s.T().Logf("%s instantiating wasm on host chain %s", sender, s.chainB.id) | ||
s.executeGaiaTxCommand(ctx, c, storeCmd, valIdx, s.defaultExecValidation(c, valIdx)) | ||
s.T().Log("successfully sent instantiate wasm tx") | ||
} | ||
|
||
func (s *IntegrationTestSuite) executeWasm(ctx context.Context, c *chain, valIdx int, sender, addr, msg string) { | ||
execCmd := []string{ | ||
gaiadBinary, | ||
txCommand, | ||
"wasm", | ||
"execute", | ||
addr, | ||
msg, | ||
fmt.Sprintf("--from=%s", sender), | ||
fmt.Sprintf("--%s=%s", flags.FlagFees, standardFees.String()), | ||
fmt.Sprintf("--%s=%s", flags.FlagChainID, c.id), | ||
"--gas=250000", | ||
"--keyring-backend=test", | ||
"--broadcast-mode=sync", | ||
"--output=json", | ||
"-y", | ||
} | ||
s.T().Logf("%s executing wasm on host chain %s", sender, s.chainB.id) | ||
s.executeGaiaTxCommand(ctx, c, execCmd, valIdx, s.defaultExecValidation(c, valIdx)) | ||
s.T().Log("successfully sent execute wasm tx") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.