Skip to content

Commit

Permalink
add compliance with gogoproto service annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
quaisx committed Apr 22, 2024
1 parent 1828350 commit 2b79913
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 118 deletions.
28 changes: 14 additions & 14 deletions deployment/docker/localsecret/bootstrap_init_no_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,20 +65,20 @@ then
c_mnemonic="chair love bleak wonder skirt permit say assist aunt credit roast size obtain minute throw sand usual age smart exact enough room shadow charge"
d_mnemonic="word twist toast cloth movie predict advance crumble escape whale sail such angry muffin balcony keen move employ cook valve hurt glimpse breeze brick"

echo $a_mnemonic | secretd keys add a --recover --keyring-backend test
echo $b_mnemonic | secretd keys add b --recover --keyring-backend test
echo $c_mnemonic | secretd keys add c --recover --keyring-backend test
echo $d_mnemonic | secretd keys add d --recover --keyring-backend test

secretd add-genesis-account "$(secretd keys show -a a --keyring-backend test)" 1000000000000000000uscrt --keyring-backend test
secretd add-genesis-account "$(secretd keys show -a b --keyring-backend test)" 1000000000000000000uscrt --keyring-backend test
secretd add-genesis-account "$(secretd keys show -a c --keyring-backend test)" 1000000000000000000uscrt --keyring-backend test
secretd add-genesis-account "$(secretd keys show -a d --keyring-backend test)" 1000000000000000000uscrt --keyring-backend test

secretd gentx a 1000000uscrt --chain-id "$chain_id" --keyring-backend test
secretd gentx b 1000000uscrt --chain-id "$chain_id" --keyring-backend test
secretd gentx c 1000000uscrt --chain-id "$chain_id" --keyring-backend test
secretd gentx d 1000000uscrt --chain-id "$chain_id" --keyring-backend test
echo $a_mnemonic | secretd keys add a --recover
echo $b_mnemonic | secretd keys add b --recover
echo $c_mnemonic | secretd keys add c --recover
echo $d_mnemonic | secretd keys add d --recover

secretd add-genesis-account "$(secretd keys show -a a)" 1000000000000000000uscrt
secretd add-genesis-account "$(secretd keys show -a b)" 1000000000000000000uscrt
secretd add-genesis-account "$(secretd keys show -a c)" 1000000000000000000uscrt
secretd add-genesis-account "$(secretd keys show -a d)" 1000000000000000000uscrt

secretd gentx a 1000000uscrt --chain-id "$chain_id"
secretd gentx b 1000000uscrt --chain-id "$chain_id"
secretd gentx c 1000000uscrt --chain-id "$chain_id"
secretd gentx d 1000000uscrt --chain-id "$chain_id"

secretd collect-gentxs
secretd validate-genesis
Expand Down
2 changes: 1 addition & 1 deletion proto/buf.gen.gogo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v1beta1
version: v1
plugins:
- name: gocosmos
out: ..
Expand Down
13 changes: 13 additions & 0 deletions proto/secret/compute/v1beta1/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ package secret.compute.v1beta1;
option go_package = "github.com/scrtlabs/SecretNetwork/x/compute/internal/types";

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos/base/v1beta1/coin.proto";

// Msg defines the wasm Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;
// StoreCode to submit Wasm code to the system
rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse);
// Instantiate creates a new smart contract instance for the given code id.
Expand All @@ -25,6 +28,8 @@ service Msg {

message MsgStoreCode {
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "source";

// sender is the canonical address of the sender
bytes sender = 1 [ (gogoproto.casttype) =
"github.com/cosmos/cosmos-sdk/types.AccAddress" ];
Expand All @@ -45,6 +50,7 @@ message MsgStoreCodeResponse {

message MsgInstantiateContract {
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "callback_code_hash";

// sender is the canonical address of the sender
bytes sender = 1 [ (gogoproto.casttype) =
Expand Down Expand Up @@ -75,6 +81,7 @@ message MsgInstantiateContractResponse {

message MsgExecuteContract {
option (gogoproto.goproto_getters) = false;
option (cosmos.msg.v1.signer) = "callback_code_hash";

// sender is the canonical address of the sender
bytes sender = 1 [ (gogoproto.casttype) =
Expand Down Expand Up @@ -104,6 +111,8 @@ message MsgExecuteContractResponse {

// MsgMigrateContract runs a code upgrade/ downgrade for a smart contract
message MsgMigrateContract {
option (cosmos.msg.v1.signer) = "sender";

// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
Expand All @@ -129,6 +138,8 @@ message MsgMigrateContractResponse {

// MsgUpdateAdmin sets a new admin for a smart contract
message MsgUpdateAdmin {
option (cosmos.msg.v1.signer) = "sender";

// Sender is the that actor that signed the messages
string sender = 1;
// NewAdmin address to be set
Expand All @@ -145,6 +156,8 @@ message MsgUpdateAdminResponse {}

// MsgClearAdmin removes any admin stored for a smart contract
message MsgClearAdmin {
option (cosmos.msg.v1.signer) = "sender";

// Sender is the that actor that signed the messages
string sender = 1;
// Contract is the address of the smart contract
Expand Down
9 changes: 8 additions & 1 deletion proto/secret/emergencybutton/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,26 @@ syntax = "proto3";
package secret.emergencybutton.v1beta1;

import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";

option go_package = "github.com/scrtlabs/SecretNetwork/x/emergencybutton/types";

// Msg defines the bank Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;

// ToggleIbcSwitch defines a method for toggling the status of the
// emergencybutton.
rpc ToggleIbcSwitch(MsgToggleIbcSwitch) returns (MsgToggleIbcSwitchResponse);
}

// MsgToggleIbcSwitch represents a message to toggle the emergencybutton status
// by the defined pauser.
message MsgToggleIbcSwitch { string sender = 1; }
message MsgToggleIbcSwitch {
option (cosmos.msg.v1.signer) = "sender";

string sender = 1; }

// MsgToggleIbcSwitchResponse defines the response type for the toggle.
message MsgToggleIbcSwitchResponse {}
5 changes: 5 additions & 0 deletions proto/secret/intertx/v1beta1/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ import "google/protobuf/any.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
import "cosmos_proto/cosmos.proto";
import "cosmos/msg/v1/msg.proto";

option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types";
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.equal_all) = true;

// Msg defines the ica-authentication Msg service.
service Msg {
option (cosmos.msg.v1.service) = true;

// Register defines a rpc handler for MsgRegisterAccount
rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse) {
option (google.api.http).post = "/mauth/v1beta1/register-account";
Expand All @@ -26,6 +29,7 @@ service Msg {
// MsgRegisterAccount registers an interchain account for the given owner over
// the specified connection pair
message MsgRegisterAccount {
option (cosmos.msg.v1.signer) = "owner";

string owner = 1;
string connection_id = 2 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ];
Expand All @@ -38,6 +42,7 @@ message MsgRegisterAccountResponse {}
// MsgSubmitTx creates and submits an arbitrary transaction msg to be executed
// using an interchain account
message MsgSubmitTx {
option (cosmos.msg.v1.signer) = "connection_id";

bytes owner = 1 [ (gogoproto.casttype) =
"github.com/cosmos/cosmos-sdk/types.AccAddress" ];
Expand Down
117 changes: 61 additions & 56 deletions x/compute/internal/types/msg.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2b79913

Please sign in to comment.