From 72a446db7ac8a27be3add3b68b043e3e84f11a34 Mon Sep 17 00:00:00 2001 From: sevenzing <41516657+sevenzing@users.noreply.github.com> Date: Wed, 9 Oct 2024 15:19:11 +0300 Subject: [PATCH] fix: change Decimal to BigDecimal (#1084) --- libs/blockscout-db/entity/src/blocks.rs | 4 ++-- libs/blockscout-db/entity/src/internal_transactions.rs | 2 +- libs/blockscout-db/entity/src/transactions.rs | 10 +++++----- libs/blockscout-db/entity/src/withdrawals.rs | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/blockscout-db/entity/src/blocks.rs b/libs/blockscout-db/entity/src/blocks.rs index 4fbde81da..76b52839a 100644 --- a/libs/blockscout-db/entity/src/blocks.rs +++ b/libs/blockscout-db/entity/src/blocks.rs @@ -9,9 +9,9 @@ pub struct Model { #[sea_orm(column_type = "Decimal(Some((50, 0)))", nullable)] pub difficulty: Option, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub gas_limit: Decimal, + pub gas_limit: BigDecimal, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub gas_used: Decimal, + pub gas_used: BigDecimal, #[sea_orm( primary_key, auto_increment = false, diff --git a/libs/blockscout-db/entity/src/internal_transactions.rs b/libs/blockscout-db/entity/src/internal_transactions.rs index ffb2cab85..7ff778751 100644 --- a/libs/blockscout-db/entity/src/internal_transactions.rs +++ b/libs/blockscout-db/entity/src/internal_transactions.rs @@ -23,7 +23,7 @@ pub struct Model { pub trace_address: Vec, pub r#type: String, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub value: Decimal, + pub value: BigDecimal, pub inserted_at: DateTime, pub updated_at: DateTime, #[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)] diff --git a/libs/blockscout-db/entity/src/transactions.rs b/libs/blockscout-db/entity/src/transactions.rs index f46448115..a8070ebcd 100644 --- a/libs/blockscout-db/entity/src/transactions.rs +++ b/libs/blockscout-db/entity/src/transactions.rs @@ -9,7 +9,7 @@ pub struct Model { pub cumulative_gas_used: Option, pub error: Option, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub gas: Decimal, + pub gas: BigDecimal, #[sea_orm(column_type = "Decimal(Some((100, 0)))", nullable)] pub gas_price: Option, #[sea_orm(column_type = "Decimal(Some((100, 0)))", nullable)] @@ -25,14 +25,14 @@ pub struct Model { pub input: Vec, pub nonce: i32, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub r: Decimal, + pub r: BigDecimal, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub s: Decimal, + pub s: BigDecimal, pub status: Option, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub v: Decimal, + pub v: BigDecimal, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub value: Decimal, + pub value: BigDecimal, pub inserted_at: DateTime, pub updated_at: DateTime, #[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)] diff --git a/libs/blockscout-db/entity/src/withdrawals.rs b/libs/blockscout-db/entity/src/withdrawals.rs index 4715168cc..00d08f130 100644 --- a/libs/blockscout-db/entity/src/withdrawals.rs +++ b/libs/blockscout-db/entity/src/withdrawals.rs @@ -9,7 +9,7 @@ pub struct Model { pub index: i32, pub validator_index: i32, #[sea_orm(column_type = "Decimal(Some((100, 0)))")] - pub amount: Decimal, + pub amount: BigDecimal, pub inserted_at: DateTime, pub updated_at: DateTime, #[sea_orm(column_type = "VarBinary(StringLen::None)")]