wrap typed data for record attributes (#70)

* unpack interface

* unpackInterfaces

* gofmpt

* patch setRecord in WrapTxToTypedData

* patch message types

* hardcode record attributes

* patch typed data

* versioning record attributes and http post rules for rpc messages

* record names
This commit is contained in:
Murali Krishna Komatireddy
2023-01-09 12:19:11 +05:30
committed by GitHub
parent 78c513d0fd
commit fac5a95679
18 changed files with 463 additions and 251 deletions
+10 -3
View File
@@ -2,6 +2,7 @@ syntax = "proto3";
package vulcanize.auction.v1beta1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "google/protobuf/duration.proto";
import "cosmos/base/v1beta1/coin.proto";
import "vulcanize/auction/v1beta1/types.proto";
@@ -85,11 +86,17 @@ message MsgRevealBidResponse {
// Tx defines the gRPC tx interface
service Msg {
// CreateAuction is the command for creating an auction
rpc CreateAuction(MsgCreateAuction) returns (MsgCreateAuctionResponse);
rpc CreateAuction(MsgCreateAuction) returns (MsgCreateAuctionResponse) {
option (google.api.http).post = "/vulcanize/auction/v1beta1/create_auction";
};
// CommitBid is the command for committing a bid
rpc CommitBid(MsgCommitBid) returns (MsgCommitBidResponse);
rpc CommitBid(MsgCommitBid) returns (MsgCommitBidResponse) {
option (google.api.http).post = "/vulcanize/auction/v1beta1/commit_bid";
};
// RevealBid is the command for revealing a bid
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse);
rpc RevealBid(MsgRevealBid) returns (MsgRevealBidResponse) {
option (google.api.http).post = "/vulcanize/auction/v1beta1/reveal_bid";
};
}
+13 -4
View File
@@ -4,21 +4,30 @@ package vulcanize.bond.v1beta1;
option go_package = "github.com/cerc-io/laconicd/x/bond/types";
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "cosmos/base/v1beta1/coin.proto";
// Msg defines the bond Msg service.
service Msg {
// CreateBond defines a method for creating a new bond.
rpc CreateBond(MsgCreateBond) returns (MsgCreateBondResponse);
rpc CreateBond(MsgCreateBond) returns (MsgCreateBondResponse) {
option (google.api.http).post = "/vulcanize/bond/v1beta1/create_bond";
};
// RefillBond defines a method for refilling amount for bond.
rpc RefillBond(MsgRefillBond) returns (MsgRefillBondResponse);
rpc RefillBond(MsgRefillBond) returns (MsgRefillBondResponse) {
option (google.api.http).post = "/vulcanize/bond/v1beta1/refill_bond";
};
// WithdrawBond defines a method for withdrawing amount from bond.
rpc WithdrawBond(MsgWithdrawBond) returns (MsgWithdrawBondResponse);
rpc WithdrawBond(MsgWithdrawBond) returns (MsgWithdrawBondResponse) {
option (google.api.http).post = "/vulcanize/bond/v1beta1/withdraw_bond";
};
// CancelBond defines a method for cancelling a bond.
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse);
rpc CancelBond(MsgCancelBond) returns (MsgCancelBondResponse) {
option (google.api.http).post = "/vulcanize/bond/v1beta1/cancel_bond";
};
}
// MsgCreateBond defines a SDK message for creating a new bond.
@@ -10,6 +10,7 @@ message ServiceProviderRegistration {
string laconic_id = 2 [(gogoproto.moretags) = "json:\"laconicId\" yaml:\"laconicId\""];
X500 x500 = 3 [(gogoproto.moretags) = "json:\"x500\" yaml:\"x500\""];
string type = 4 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
}
message X500 {
@@ -28,4 +29,5 @@ message WebsiteRegistrationRecord {
string build_artifact_cid = 3 [(gogoproto.moretags) = "json:\"buildArtifactCID\" yaml:\"buildArtifactCID\""];
string tls_cert_cid = 4 [(gogoproto.moretags) = "json:\"TLSCertCID\" yaml:\"TLSCertCID\""];
string type = 5 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
string version = 6 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
}
+31 -10
View File
@@ -2,6 +2,7 @@ syntax = "proto3";
package vulcanize.registry.v1beta1;
import "gogoproto/gogo.proto";
import "google/api/annotations.proto";
import "vulcanize/registry/v1beta1/registry.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
@@ -9,25 +10,45 @@ option go_package = "github.com/cerc-io/laconicd/x/registry/types";
// Msg
service Msg {
// SetRecord will records a new record with given payload and bond id
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {}
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/set_record";
}
// Renew Record will renew the expire record
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {}
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/renew_record";
}
// AssociateBond
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {}
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/associate_bond";
}
// DissociateBond
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {}
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/dissociate_bond";
}
// DissociateRecords
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {}
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/dissociate_records";
}
// ReAssociateRecords
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {}
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/reassociate_records";
}
// SetName will store the name with given crn and name
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {}
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/set_name";
}
// Reserve name
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {}
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/reserve_name";
}
// Delete Name method will remove authority name
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {}
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/delete_name";
}
// SetAuthorityBond
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {}
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {
option (google.api.http).post = "/vulcanize/registry/v1beta1/set_authority_bond";
}
}
// MsgSetRecord