From 8ebe7000add9fd932345b7fd5975ea162c985a28 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Tue, 16 Aug 2022 17:55:44 +0000 Subject: [PATCH] Address, not String --- TODO.md | 1 + web3_proxy/src/bin/web3_proxy_cli/create_user.rs | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index b4b78bd5..c67e07d1 100644 --- a/TODO.md +++ b/TODO.md @@ -88,6 +88,7 @@ - [x] send getTransaction rpc requests to the private rpc tier - [x] I'm hitting infura rate limits very quickly. I feel like that means something is very inefficient - whenever blocks were slow, we started checking as fast as possible +- [x] create user script should allow setting requests per minute - [-] basic request method stats (using the user_id and other fields that are in the tracing frame) - [ ] use siwe messages and signatures for sign up and login - [ ] "chain is forked" message is wrong. it includes nodes just being on different heights of the same chain. need a smarter check diff --git a/web3_proxy/src/bin/web3_proxy_cli/create_user.rs b/web3_proxy/src/bin/web3_proxy_cli/create_user.rs index 2534c65f..c74feb07 100644 --- a/web3_proxy/src/bin/web3_proxy_cli/create_user.rs +++ b/web3_proxy/src/bin/web3_proxy_cli/create_user.rs @@ -17,7 +17,7 @@ fn default_rpm() -> u32 { pub struct CreateUserSubCommand { #[argh(option)] /// the user's ethereum address - address: String, + address: Address, #[argh(option)] /// the user's optional email @@ -38,12 +38,8 @@ impl CreateUserSubCommand { let txn = db.begin().await?; // TODO: would be nice to use the fixed array instead of a Vec in the entities - let address = self - .address - .parse::
() - .context("Failed parsing new user address")? - .to_fixed_bytes() - .into(); + // TODO: how can we use custom types with + let address = self.address.to_fixed_bytes().into(); let u = user::ActiveModel { address: sea_orm::Set(address),