Skip to content

Commit fb79b8e

Browse files
authored
Merge pull request #840 from input-output-hk/greg/827/open_message
open message provider & repository
2 parents 2dea4f4 + 053da49 commit fb79b8e

File tree

12 files changed

+587
-21
lines changed

12 files changed

+587
-21
lines changed

Cargo.lock

Lines changed: 19 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mithril-aggregator/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator"
3-
version = "0.2.42"
3+
version = "0.2.43"
44
description = "A Mithril Aggregator server"
55
authors = { workspace = true }
66
edition = { workspace = true }
@@ -32,6 +32,7 @@ tar = "0.4.38"
3232
thiserror = "1.0.31"
3333
tokio = { version = "1.17.0", features = ["full"] }
3434
tokio-util = { version = "0.7.1", features = ["codec"] }
35+
uuid = { version = "1.3.0", features = ["v4", "fast-rng", "macro-diagnostics"] }
3536
warp = "0.3"
3637

3738
[dev-dependencies]

mithril-aggregator/src/database/migration.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,24 @@ insert into certificate (certificate_id,
128128
from certificate_temp as c;
129129
create index epoch_index ON certificate(epoch);
130130
drop table certificate_temp;
131+
"#,
132+
),
133+
// Migration 5
134+
// Add the `open_message` table
135+
SqlMigration::new(
136+
5,
137+
r#"
138+
create table open_message (
139+
open_message_id text not null,
140+
epoch_setting_id int not null,
141+
beacon json not null,
142+
signed_entity_type_id int not null,
143+
message text not null,
144+
created_at text not null default current_timestamp,
145+
primary key (open_message_id),
146+
foreign key (epoch_setting_id) references epoch_setting (epoch_setting_id),
147+
foreign key (signed_entity_type_id) references signed_entity_type (signed_entity_type_id)
148+
);
131149
"#,
132150
),
133151
]

mithril-aggregator/src/database/provider/epoch_setting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl SqLiteEntity for EpochSettingRecord {
7676
}
7777
}
7878

79-
/// Simple [EpochSetting] provider.
79+
/// Simple [EpochSettingRecord] provider.
8080
pub struct EpochSettingProvider<'client> {
8181
client: &'client Connection,
8282
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
//! Aggregator related database providers
22
mod certificate;
33
mod epoch_setting;
4+
mod open_message;
45
mod stake_pool;
56

67
pub use certificate::*;
78
pub use epoch_setting::*;
9+
pub use open_message::*;
810
pub use stake_pool::*;

0 commit comments

Comments
 (0)