From a3bba433603223a7218ee96661c19f68a4e0c86e Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sat, 24 Sep 2022 07:03:29 +0000 Subject: [PATCH] allow null calldata --- Cargo.lock | 1 + entities/src/revert_logs.rs | 4 ++-- migration/src/m20220921_181610_log_reverts.rs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2836b89e..8384a809 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5546,6 +5546,7 @@ dependencies = [ "moka", "notify", "num", + "num-traits", "parking_lot 0.12.1", "petgraph", "proctitle", diff --git a/entities/src/revert_logs.rs b/entities/src/revert_logs.rs index 9d466590..f20bcfe5 100644 --- a/entities/src/revert_logs.rs +++ b/entities/src/revert_logs.rs @@ -13,8 +13,8 @@ pub struct Model { pub timestamp: DateTimeUtc, pub method: Method, pub to: Vec, - #[sea_orm(column_type = "Text")] - pub call_data: String, + #[sea_orm(column_type = "Text", nullable)] + pub call_data: Option, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/migration/src/m20220921_181610_log_reverts.rs b/migration/src/m20220921_181610_log_reverts.rs index 3cb73b84..12b5e89e 100644 --- a/migration/src/m20220921_181610_log_reverts.rs +++ b/migration/src/m20220921_181610_log_reverts.rs @@ -61,7 +61,7 @@ impl MigrationTrait for Migration { .not_null(), ) .col(ColumnDef::new(RevertLogs::To).binary_len(20).not_null()) - .col(ColumnDef::new(RevertLogs::CallData).text().not_null()) + .col(ColumnDef::new(RevertLogs::CallData).text().null()) .index(sea_query::Index::create().col(RevertLogs::To)) .foreign_key( sea_query::ForeignKey::create()