Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove block height foreign key from propoval vote and deposit, add timestamp column #489

Merged
merged 6 commits into from
Oct 27, 2022

Conversation

huichiaotsou
Copy link
Contributor

@huichiaotsou huichiaotsou commented Oct 25, 2022

Description

block height foreign key on proposal_vote and proposal_deposit tables is getting parse genesis-file errors because the block table could be empty at the time of parsing genesis. It results in the error like pq: insert or update on table "proposal_deposit" violates foreign key constraint "proposal_deposit_height_fkey"

Add timestamp column so frontend can access this data.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch
  • provided a link to the relevant issue or specification
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@huichiaotsou huichiaotsou changed the title fix: remove proposal foreign key fix: remove proposal_vote and proposal_deposit height foreign key Oct 25, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 25, 2022

Codecov Report

❗ No coverage uploaded for pull request base (cosmos/v0.44.x@5d34331). Click here to learn what that means.
The diff coverage is n/a.

@@                Coverage Diff                @@
##             cosmos/v0.44.x     #489   +/-   ##
=================================================
  Coverage                  ?   57.49%           
=================================================
  Files                     ?       19           
  Lines                     ?     1447           
  Branches                  ?        0           
=================================================
  Hits                      ?      832           
  Misses                    ?      511           
  Partials                  ?      104           

@huichiaotsou huichiaotsou marked this pull request as ready for review October 25, 2022 13:03
@huichiaotsou huichiaotsou added the automerge Automatically merge PR once all prerequisites pass label Oct 25, 2022
@MonikaCat
Copy link
Contributor

Hey @huichiaotsou I remember we added those references to display vote and deposit timestamp. I think we can add timestamp column inside proposal_vote and proposal_deposit table and then we can drop those references

@huichiaotsou huichiaotsou changed the title fix: remove proposal_vote and proposal_deposit height foreign key fix: remove proposal_vote and proposal_deposit block height foreign key and add column timestamp Oct 26, 2022
Copy link
Contributor

@MonikaCat MonikaCat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@RiccardoM RiccardoM changed the title fix: remove proposal_vote and proposal_deposit block height foreign key and add column timestamp feat: remove block height foreign key from propoval vote and deposit, add timestamp column Oct 27, 2022
Copy link
Contributor

@RiccardoM RiccardoM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@mergify mergify bot merged commit c999075 into cosmos/v0.44.x Oct 27, 2022
@mergify mergify bot deleted the aaron/remove_deposit_fk branch October 27, 2022 14:09
ankurdotb pushed a commit to cheqd/bdjuno that referenced this pull request Nov 1, 2022
… add timestamp column (forbole#489)

block height foreign key on `proposal_vote` and `proposal_deposit` tables is getting `parse genesis-file` errors because the block table could be empty at the time of parsing genesis. It results in the error like `pq: insert or update on table "proposal_deposit" violates foreign key constraint "proposal_deposit_height_fkey"`

Add `timestamp` column so frontend can access this data.

---

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch
- [ ] provided a link to the relevant issue or specification
- [x] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)
ankurdotb added a commit to cheqd/bdjuno that referenced this pull request Nov 1, 2022
* build(deps): bump github.com/spf13/cobra from 1.6.0 to 1.6.1 (forbole#488)

Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.6.0 to 1.6.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/spf13/cobra/releases">github.com/spf13/cobra's releases</a>.</em></p>
<blockquote>
<h2>v1.6.1</h2>
<h3>Bug fixes 🐛</h3>
<ul>
<li>Fixes a panic when <code>AddGroup</code> isn't called before <code>AddCommand(my-sub-command)</code> is executed. This can happen within more complex cobra file structures that have many different <code>init</code>s to be executed. Now, the check for groups has been moved to <code>ExecuteC</code> and provides more flexibility when working with grouped commands - <a href="https://github.com/marckhouzam"><code>@​marckhouzam</code></a> (and shout out to <a href="https://github.com/aawsome"><code>@​aawsome</code></a>, <a href="https://github.com/andig"><code>@​andig</code></a> and <a href="https://github.com/KINGSABRI"><code>@​KINGSABRI</code></a> for a deep investigation into this! 👏🏼)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/spf13/cobra/commit/b43be995ebb4bee335a787bd44498b91aef7619c"><code>b43be99</code></a> Check for group presence after full initialization (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1839">#1839</a>) (<a href="https://github-redirect.dependabot.com/spf13/cobra/issues/1841">#1841</a>)</li>
<li>See full diff in <a href="https://github.com/spf13/cobra/compare/v1.6.0...v1.6.1">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/spf13/cobra&package-manager=go_modules&previous-version=1.6.0&new-version=1.6.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

* fix: improve Hasura permissions (forbole#473)

Closes: #XXXX

---

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [ ] targeted the correct branch
- [ ] provided a link to the relevant issue or specification
- [ ] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [ ] reviewed "Files changed" and left comments if necessary
- [ ] confirmed all CI checks have passed

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

* feat: remove block height foreign key from propoval vote and deposit, add timestamp column (forbole#489)

block height foreign key on `proposal_vote` and `proposal_deposit` tables is getting `parse genesis-file` errors because the block table could be empty at the time of parsing genesis. It results in the error like `pq: insert or update on table "proposal_deposit" violates foreign key constraint "proposal_deposit_height_fkey"`

Add `timestamp` column so frontend can access this data.

---

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch
- [ ] provided a link to the relevant issue or specification
- [x] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

* feat: add host address to hasura actions (forbole#491)

Fixes forbole#490

---

*All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.*

I have...

- [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] added `!` to the type prefix if API or client breaking change
- [x] targeted the correct branch
- [x] provided a link to the relevant issue or specification
- [x] added a changelog entry to `CHANGELOG.md`
- [ ] included comments for [documenting Go code](https://blog.golang.org/godoc)
- [ ] updated the relevant documentation or specification
- [x] reviewed "Files changed" and left comments if necessary
- [x] confirmed all CI checks have passed

*All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.*

I have...

- [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title
- [ ] confirmed `!` in the type prefix if API or client breaking change
- [ ] confirmed all author checklist items have been addressed
- [ ] reviewed API design and naming
- [ ] reviewed documentation is accurate
- [ ] reviewed tests and test coverage
- [ ] manually tested (if applicable)

* Fix merge conflicts

* fix: Linting

* Switch struct order in gov database types

* Switch Config struct

* Update gov.go

* Update .golangci.yaml

* Sync linter with upstream

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Magic Cat <37407870+MonikaCat@users.noreply.github.com>
Co-authored-by: Aaron <76254323+huichiaotsou@users.noreply.github.com>
Co-authored-by: jay-dee7 <jasdeepsingh.uppal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once all prerequisites pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants