Skip to content

Commit

Permalink
view(storage): populate distributions parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanor committed Nov 20, 2023
1 parent 112584b commit 4473418
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions crates/view/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ impl Storage {
[dao_params_bytes],
)?;

let distributions_params_bytes =
&DistributionsParameters::encode_to_vec(&params.distributions_params)[..];
tx.execute(
"INSERT INTO distributions_params (bytes) VALUES (?1)",
[distributions_params_bytes],
)?;

let governance_params_bytes =
&GovernanceParameters::encode_to_vec(&params.governance_params)[..];
tx.execute(
Expand Down Expand Up @@ -1376,6 +1383,12 @@ impl Storage {
[dao_params_bytes],
)?;

let distributions_params_bytes = &DistributionsParameters::encode_to_vec(&params.distributions_params)[..];
dbtx.execute(
"UPDATE distributions_params SET bytes = ?1",
[distributions_params_bytes],
)?;

let governance_params_bytes =
&GovernanceParameters::encode_to_vec(&params.governance_params)[..];
dbtx.execute(
Expand Down

0 comments on commit 4473418

Please sign in to comment.