-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #366 from CosmWasm/grpc_service_328
Refactor to GRPC message server
- Loading branch information
Showing
19 changed files
with
3,956 additions
and
2,521 deletions.
There are no files selected for viewing
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package wasm | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/stretchr/testify/require" | ||
"testing" | ||
) | ||
|
||
// ensure store code returns the expected response | ||
func assertStoreCodeResponse(t *testing.T, data []byte, expected uint64) { | ||
var pStoreResp MsgStoreCodeResponse | ||
require.NoError(t, pStoreResp.Unmarshal(data)) | ||
require.Equal(t, pStoreResp.CodeID, expected) | ||
} | ||
|
||
// ensure execution returns the expected data | ||
func assertExecuteResponse(t *testing.T, data []byte, expected []byte) { | ||
var pExecResp MsgExecuteContractResponse | ||
require.NoError(t, pExecResp.Unmarshal(data)) | ||
require.Equal(t, pExecResp.Data, expected) | ||
} | ||
|
||
// ensures this returns a valid bech32 address and returns it | ||
func parseInitResponse(t *testing.T, data []byte) string { | ||
var pInstResp MsgInstantiateContractResponse | ||
require.NoError(t, pInstResp.Unmarshal(data)) | ||
require.NotEmpty(t, pInstResp.Address) | ||
addr := pInstResp.Address | ||
// ensure this is a valid sdk address | ||
_, err := sdk.AccAddressFromBech32(addr) | ||
require.NoError(t, err) | ||
return addr | ||
} |
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.