-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* drep tasks and sancho support * drep delegation for adddress and votes for address endpoints * use a credential instead of bech32 address * votes for action ids endpoint * voting task: avoid insert when empty * all votes endpoint: rename and fix doc * add transaction history drep filters * update cml (to non merged branch) * fix route name inconsistencies and wrong tx id format * fix VoteDelegCert credential format * multiera address task: implement the combined certificates * multiera address delegation: add new certificates * multiera_drep_delegation add combined certs * multiera address: clippy * cardano sink: handle conway era * cardano net setting: handle sancho * fix multiera_drep_delegation not using drep credential * Bump to cml 5.3.0 --------- Co-authored-by: Sebastien Guillemot <[email protected]>
- Loading branch information
1 parent
75cb89b
commit c3c94fd
Showing
54 changed files
with
1,433 additions
and
140 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,25 @@ | ||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize)] | ||
#[sea_orm(table_name = "GovernanceVote")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, column_type = "BigInteger")] | ||
pub id: i64, | ||
pub tx_id: i64, | ||
pub voter: Vec<u8>, | ||
pub gov_action_id: Vec<u8>, | ||
pub vote: Vec<u8>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, DeriveRelation, EnumIter)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::transaction::Entity", | ||
from = "Column::TxId", | ||
to = "super::transaction::Column::Id" | ||
)] | ||
Transaction, | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
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,37 @@ | ||
use sea_orm::entity::prelude::*; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel, Deserialize, Serialize)] | ||
#[sea_orm(table_name = "StakeDelegationDrepCredentialRelation")] | ||
pub struct Model { | ||
#[sea_orm(primary_key, column_type = "BigInteger")] | ||
pub id: i64, | ||
pub stake_credential: i64, | ||
pub drep_credential: Option<Vec<u8>>, | ||
pub tx_id: i64, | ||
pub previous_drep_credential: Option<Vec<u8>>, | ||
} | ||
|
||
#[derive(Copy, Clone, Debug, DeriveRelation, EnumIter)] | ||
pub enum Relation { | ||
#[sea_orm( | ||
belongs_to = "super::stake_credential::Entity", | ||
from = "Column::StakeCredential", | ||
to = "super::stake_credential::Column::Id" | ||
)] | ||
StakeCredential, | ||
#[sea_orm( | ||
belongs_to = "super::transaction::Entity", | ||
from = "Column::TxId", | ||
to = "super::transaction::Column::Id" | ||
)] | ||
Transaction, | ||
} | ||
|
||
impl Related<super::stake_credential::Entity> for Entity { | ||
fn to() -> RelationDef { | ||
Relation::StakeCredential.def() | ||
} | ||
} | ||
|
||
impl ActiveModelBehavior for ActiveModel {} |
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,62 @@ | ||
{ | ||
"avvmDistr": {}, | ||
"blockVersionData": { | ||
"heavyDelThd": "300000000000", | ||
"maxBlockSize": "2000000", | ||
"maxHeaderSize": "2000000", | ||
"maxProposalSize": "700", | ||
"maxTxSize": "4096", | ||
"mpcThd": "20000000000000", | ||
"scriptVersion": 0, | ||
"slotDuration": "20000", | ||
"softforkRule": { | ||
"initThd": "900000000000000", | ||
"minThd": "600000000000000", | ||
"thdDecrement": "50000000000000" | ||
}, | ||
"txFeePolicy": { | ||
"multiplier": "43946000000", | ||
"summand": "155381000000000" | ||
}, | ||
"unlockStakeEpoch": "18446744073709551615", | ||
"updateImplicit": "10000", | ||
"updateProposalThd": "100000000000000", | ||
"updateVoteThd": "1000000000000" | ||
}, | ||
"bootStakeholders": { | ||
"318488dc356f6034104804b2cb6a2dcc055202491386fb0d5af7c3ba": 1, | ||
"3a3c2ffaf066c8f211a1bdfd844f767ac453b1d94915e725c5867467": 1, | ||
"3ae8eabb4e0626cea0ba38d8303d59514dae9c307d93bad3d259e4a9": 1 | ||
}, | ||
"heavyDelegation": { | ||
"318488dc356f6034104804b2cb6a2dcc055202491386fb0d5af7c3ba": { | ||
"cert": "b80e06679023284236df3464dc6aab3f56f23cb721d5943c59632ac77004f76ae415b6d291606c7194509e1fefa0c8341eed269bd0e0e1433302b00912a4230c", | ||
"delegatePk": "9ELoyHN4GVtXrFzAJZApAVjrhwftqEFVoDXl9ebtTwpe/lG4b5ZkgH3DqwHE1hNJFRsnYs4zYzMmdbnoR7lfUA==", | ||
"issuerPk": "MHFL9SqIV6KuXSAvp08jHBRtHwNsDJMsCxbmXLorSbfLAORg7waqVL8NEaKU3Lb0FBIX5sHVC21i1M/c0jrnlA==", | ||
"omega": 0 | ||
}, | ||
"3a3c2ffaf066c8f211a1bdfd844f767ac453b1d94915e725c5867467": { | ||
"cert": "ce91b8e35b67de2236fa79b353d1c4ebd97ad4b4cc89056a1acfc217ece8e91fbffc4bf44604a96a1064c9997f6cd39b81284aadfac752056eafc6b5996a6509", | ||
"delegatePk": "Grpf6iTqd9aWc3QWvfthNv2l8Pp0X2tKpoIoPn0+Dy1+ow60UTu9i1j4KPjp1uzrnM4JoUcmkCGF507fPagO8w==", | ||
"issuerPk": "1FPA7qSOPVDlNZoQAuoB2dnm+tKI5td6+BO5sJ2rswVxuS6S6sjBFVfVz/VXfKTcEt/AKyffgzWXAtPCnhC1jw==", | ||
"omega": 0 | ||
}, | ||
"3ae8eabb4e0626cea0ba38d8303d59514dae9c307d93bad3d259e4a9": { | ||
"cert": "908dd25262598050d60cb24928a7059fea3726a1dd7764645edab654d3b4e37ba69acd4841454f70f0f643305ede0ef66dc0ea9747a2387da05d2af77963f30a", | ||
"delegatePk": "1zYduiReianx6HJHgQqtira7XY6M/Ol4tFj/O7TzTLcNfgazJm8pq5y6HAANwl91iL1pDZuIgFjzI+2i1Z6y2Q==", | ||
"issuerPk": "Pgj3IyTJDyxr+t5fcMuM3aPtyNCxOo4T9sr78BNbgWBGwlTGo0P6UtzNLyqloLsH8V6Lv6kYMdWELAiEyfCpkw==", | ||
"omega": 0 | ||
} | ||
}, | ||
"nonAvvmBalances": { | ||
"FHnt4NL7yPXqn7xha3WB99wYLxAc1FhceD3D1pQWaCthk9RYB46aGb6Tbq2KxV5": "0", | ||
"FHnt4NL7yPXwj8m191s48v1RZtQqA2sVHpamzStuXTuAnzYUSR6hRPqhYmW3MY4": "0", | ||
"FHnt4NL7yPXzVZ5xexcb7rWqCYWuFU7y6Pp4tLTiv6txhDcpQ2m7AFGMirsi1F1": "30000000000000000", | ||
"FHnt4NL7yPY27r794z4UiYJ3RwezucDRLX94Pzy6mYPNUNWboB71S9xUm2WEDrv": "0" | ||
}, | ||
"protocolConsts": { | ||
"k": 432, | ||
"protocolMagic": 4 | ||
}, | ||
"startTime": 1686789000 | ||
} |
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
75 changes: 75 additions & 0 deletions
75
indexer/migration/src/m20240326_000020_create_drep_delegation_table.rs
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,75 @@ | ||
use entity::prelude::{StakeCredential, StakeCredentialColumn, Transaction, TransactionColumn}; | ||
use entity::stake_delegation_drep::*; | ||
use sea_schema::migration::prelude::*; | ||
|
||
pub struct Migration; | ||
|
||
impl MigrationName for Migration { | ||
fn name(&self) -> &str { | ||
"m20240326_000020_create_drep_delegation_table" | ||
} | ||
} | ||
|
||
#[async_trait::async_trait] | ||
impl MigrationTrait for Migration { | ||
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.create_table( | ||
Table::create() | ||
.table(Entity) | ||
.if_not_exists() | ||
.col( | ||
ColumnDef::new(Column::Id) | ||
.big_integer() | ||
.not_null() | ||
.auto_increment(), | ||
) | ||
.col( | ||
ColumnDef::new(Column::StakeCredential) | ||
.big_integer() | ||
.not_null(), | ||
) | ||
.col(ColumnDef::new(Column::TxId).big_integer().not_null()) | ||
.col(ColumnDef::new(Column::DrepCredential).binary()) | ||
.col(ColumnDef::new(Column::PreviousDrepCredential).binary()) | ||
.foreign_key( | ||
ForeignKey::create() | ||
.name("fk-stake_delegation_drep-credential_id") | ||
.from(Entity, Column::StakeCredential) | ||
.to(StakeCredential, StakeCredentialColumn::Id) | ||
.on_delete(ForeignKeyAction::Cascade), | ||
) | ||
.foreign_key( | ||
ForeignKey::create() | ||
.name("fk-stake_delegation_drep-tx_id") | ||
.from(Entity, Column::TxId) | ||
.to(Transaction, TransactionColumn::Id) | ||
.on_delete(ForeignKeyAction::Cascade), | ||
) | ||
.primary_key( | ||
Index::create() | ||
.table(Entity) | ||
.name("stake_delegation_drep_credential-pk") | ||
.col(Column::Id), | ||
) | ||
.to_owned(), | ||
) | ||
.await?; | ||
|
||
manager | ||
.create_index( | ||
Index::create() | ||
.table(Entity) | ||
.name("index-stake_delegation_credential_drep-stake_credential") | ||
.col(Column::StakeCredential) | ||
.to_owned(), | ||
) | ||
.await | ||
} | ||
|
||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> { | ||
manager | ||
.drop_table(Table::drop().table(Entity).to_owned()) | ||
.await | ||
} | ||
} |
Oops, something went wrong.