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

Add serde derives for GasPrices #3948

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/core/component/fee/src/gas.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::{iter::Sum, ops::Add};

use serde::{Deserialize, Serialize};

use penumbra_num::Amount;
use penumbra_proto::{core::component::fee::v1 as pb, DomainType};

Expand Down Expand Up @@ -49,7 +51,8 @@ impl Sum for Gas {
/// These prices have an implicit denominator of 1,000 relative to the base unit
/// of the staking token, so gas price 1,000 times 1 unit of gas is 1 base unit
/// of staking token.
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, Default, Serialize, Deserialize)]
#[serde(try_from = "pb::GasPrices", into = "pb::GasPrices")]
pub struct GasPrices {
pub block_space_price: u64,
pub compact_block_space_price: u64,
Expand Down
Loading