-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: balances and validators lists improvements * feat: pos and gov changes * feat: make data and pagination required in swagger * feat: return proposals time * feat: tally type * feat: revealed pks * feat: gas table * fix: clippy
- Loading branch information
1 parent
9b1f96c
commit 59dbe5e
Showing
61 changed files
with
1,080 additions
and
163 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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ pub mod balance; | |
pub mod crawler; | ||
pub mod gov; | ||
pub mod pos; | ||
pub mod revealed_pk; |
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,22 @@ | ||
use anyhow::Context; | ||
use diesel::{PgConnection, RunQueryDsl}; | ||
use orm::{revealed_pk::RevealedPkInsertDb, schema::revealed_pk}; | ||
use shared::{id::Id, public_key::PublicKey}; | ||
|
||
pub fn insert_revealed_pks( | ||
transaction_conn: &mut PgConnection, | ||
revealed_pks: Vec<(PublicKey, Id)>, | ||
) -> anyhow::Result<()> { | ||
diesel::insert_into(revealed_pk::table) | ||
.values::<&Vec<RevealedPkInsertDb>>( | ||
&revealed_pks | ||
.into_iter() | ||
.map(|(pk, address)| RevealedPkInsertDb::from(pk, address)) | ||
.collect::<Vec<_>>(), | ||
) | ||
.on_conflict_do_nothing() | ||
.execute(transaction_conn) | ||
.context("Failed to update balances in db")?; | ||
|
||
anyhow::Ok(()) | ||
} |
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
Empty file.
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
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,3 @@ | ||
-- This file should undo anything in `up.sql` | ||
|
||
DROP TABLE IF EXISTS revealed_pk; |
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,9 @@ | ||
-- Your SQL goes here | ||
|
||
CREATE TABLE revealed_pk ( | ||
id SERIAL PRIMARY KEY, | ||
address VARCHAR NOT NULL, | ||
pk VARCHAR NOT NULL | ||
); | ||
|
||
ALTER TABLE revealed_pk ADD UNIQUE (address, pk); |
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.