Skip to content

Commit

Permalink
Update MsgStoreRawDataRequest.Hash to ContentHash (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
blushi authored Feb 4, 2021
1 parent ab03b73 commit 6f743dc
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 57 deletions.
2 changes: 1 addition & 1 deletion docs/modules/data/protobuf.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ MsgStoreRawDataRequest is the Msg/StoreRawData request type.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| sender | [string](#string) | | sender is the address of the sender of the transaction. The sender in StoreData is not attesting to the veracity of the underlying data. They can simply be a intermediary providing services. |
| hash | [ContentHash.Raw](#regen.data.v1alpha2.ContentHash.Raw) | | hash is the hash-based identifier for the anchored content. |
| content_hash | [ContentHash.Raw](#regen.data.v1alpha2.ContentHash.Raw) | | content_hash is the hash-based identifier for the anchored content. |
| content | [bytes](#bytes) | | content is the content of the raw data corresponding to the provided content hash. |


Expand Down
4 changes: 2 additions & 2 deletions docs/modules/group/protobuf.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ ThresholdDecisionPolicy implements the DecisionPolicy interface

| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| threshold | [string](#string) | | threshold is a fix weight value that must be met or exceeded for a proposal to succeed. |
| threshold | [string](#string) | | threshold is the minimum weighted sum of yes votes that must be met or exceeded for a proposal to succeed. |
| timeout | [google.protobuf.Duration](#google.protobuf.Duration) | | timeout is the duration from submission of a proposal to the end of voting period Within this times votes and exec messages can be submitted. |


Expand Down Expand Up @@ -782,7 +782,7 @@ Query is the regen.group.v1alpha1 Query service.
| ----------- | ------------ | ------------- | ------------|
| GroupInfo | [QueryGroupInfoRequest](#regen.group.v1alpha1.QueryGroupInfoRequest) | [QueryGroupInfoResponse](#regen.group.v1alpha1.QueryGroupInfoResponse) | GroupInfo queries group info based on group id. |
| GroupAccountInfo | [QueryGroupAccountInfoRequest](#regen.group.v1alpha1.QueryGroupAccountInfoRequest) | [QueryGroupAccountInfoResponse](#regen.group.v1alpha1.QueryGroupAccountInfoResponse) | GroupAccountInfo queries group account info based on group account address. |
| GroupMembers | [QueryGroupMembersRequest](#regen.group.v1alpha1.QueryGroupMembersRequest) | [QueryGroupMembersResponse](#regen.group.v1alpha1.QueryGroupMembersResponse) | GroupMembers queries members for a group |
| GroupMembers | [QueryGroupMembersRequest](#regen.group.v1alpha1.QueryGroupMembersRequest) | [QueryGroupMembersResponse](#regen.group.v1alpha1.QueryGroupMembersResponse) | GroupMembers queries members of a group |
| GroupsByAdmin | [QueryGroupsByAdminRequest](#regen.group.v1alpha1.QueryGroupsByAdminRequest) | [QueryGroupsByAdminResponse](#regen.group.v1alpha1.QueryGroupsByAdminResponse) | GroupsByAdmin queries groups by admin address. |
| GroupAccountsByGroup | [QueryGroupAccountsByGroupRequest](#regen.group.v1alpha1.QueryGroupAccountsByGroupRequest) | [QueryGroupAccountsByGroupResponse](#regen.group.v1alpha1.QueryGroupAccountsByGroupResponse) | GroupAccountsByGroup queries group accounts by group id. |
| GroupAccountsByAdmin | [QueryGroupAccountsByAdminRequest](#regen.group.v1alpha1.QueryGroupAccountsByAdminRequest) | [QueryGroupAccountsByAdminResponse](#regen.group.v1alpha1.QueryGroupAccountsByAdminResponse) | GroupsByAdmin queries group accounts by admin address. |
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (
github.com/stretchr/testify v1.7.0
github.com/tendermint/tendermint v0.34.3
github.com/tendermint/tm-db v0.6.3
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 // indirect
google.golang.org/genproto v0.0.0-20210203152818-3206188e46ba // indirect
google.golang.org/grpc v1.35.0
gopkg.in/yaml.v2 v2.4.0
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,8 @@ google.golang.org/genproto v0.0.0-20201111145450-ac7456db90a6/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20201211151036-40ec1c210f7a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210114201628-6edceaf6022f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506 h1:uLBY0yHDCj2PMQ98KWDSIDFwn9zK2zh+tgWtbvPPBjI=
google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210203152818-3206188e46ba h1:np3A9jnmE/eMtrOwwvUycmQ1XoLyj5nqZ41bAyYLqJ0=
google.golang.org/genproto v0.0.0-20210203152818-3206188e46ba/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
Expand Down
6 changes: 3 additions & 3 deletions x/data/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ func (m *MsgSignDataRequest) GetSigners() []sdk.AccAddress {
}

func (m *MsgStoreRawDataRequest) ValidateBasic() error {
err := m.Hash.Validate()
err := m.ContentHash.Validate()
if err != nil {
return err
}

digestAlgorithm := m.Hash.DigestAlgorithm
digestAlgorithm := m.ContentHash.DigestAlgorithm
switch digestAlgorithm {
case DigestAlgorithm_DIGEST_ALGORITHM_BLAKE2B_256:
hash := crypto.BLAKE2b_256.New()
Expand All @@ -61,7 +61,7 @@ func (m *MsgStoreRawDataRequest) ValidateBasic() error {
}

digest := hash.Sum(nil)
if !bytes.Equal(m.Hash.Hash, digest) {
if !bytes.Equal(m.ContentHash.Hash, digest) {
return ErrHashVerificationFailed
}

Expand Down
6 changes: 3 additions & 3 deletions x/data/requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ func TestMsgStoreRawDataRequest_ValidateBasic(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
m := &MsgStoreRawDataRequest{
Sender: tt.fields.Sender,
Hash: tt.fields.Hash,
Content: tt.fields.Content,
Sender: tt.fields.Sender,
ContentHash: tt.fields.Hash,
Content: tt.fields.Content,
}
err := m.ValidateBasic()
if len(tt.wantErr) != 0 {
Expand Down
85 changes: 43 additions & 42 deletions x/data/tx.pb.go

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

4 changes: 2 additions & 2 deletions x/group/query_cosmos.pb.go

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

2 changes: 1 addition & 1 deletion x/group/types.pb.go

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

0 comments on commit 6f743dc

Please sign in to comment.