Skip to content

Commit

Permalink
feat: WIP rpc entry point routing
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Mar 11, 2024
1 parent 8f57a28 commit a8a3ec9
Show file tree
Hide file tree
Showing 23 changed files with 1,288 additions and 594 deletions.
50 changes: 26 additions & 24 deletions bin/tools/src/bin/get_example_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,30 @@
// You should have received a copy of the GNU General Public License along with Rundler.
// If not, see https://www.gnu.org/licenses/.

use dotenv::dotenv;
use rundler_dev::DevClients;
use rundler_rpc::RpcUserOperation;
// use dotenv::dotenv;
// use rundler_dev::DevClients;
// use rundler_rpc::RpcUserOperation;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
dotenv()?;
let clients = DevClients::new_from_env()?;
// We'll make operations that call the entry point's addStake.
let op = clients
.new_wallet_op(clients.entry_point.add_stake(1), 1.into())
.await?;
println!("User operation to make wallet call EntryPoint#addStake():");
println!(
"{}",
serde_json::to_string(&RpcUserOperation::from(op.clone()))?
);
let op = clients
.new_wallet_op_with_paymaster(clients.entry_point.add_stake(1), 1.into())
.await?;
println!();
println!("User operation to make wallet call EntryPoint#addStake() with paymaster:");
println!("{}", serde_json::to_string(&RpcUserOperation::from(op))?);
Ok(())
}
// #[tokio::main]
// async fn main() -> anyhow::Result<()> {
// dotenv()?;
// let clients = DevClients::new_from_env()?;
// // We'll make operations that call the entry point's addStake.
// let op = clients
// .new_wallet_op(clients.entry_point.add_stake(1), 1.into())
// .await?;
// println!("User operation to make wallet call EntryPoint#addStake():");
// println!(
// "{}",
// serde_json::to_string(&RpcUserOperation::from(op.clone()))?
// );
// let op = clients
// .new_wallet_op_with_paymaster(clients.entry_point.add_stake(1), 1.into())
// .await?;
// println!();
// println!("User operation to make wallet call EntryPoint#addStake() with paymaster:");
// println!("{}", serde_json::to_string(&RpcUserOperation::from(op))?);
// Ok(())
// }

fn main() {}
2 changes: 1 addition & 1 deletion crates/rpc/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ where
.await
.map_err(|e| rpc_err(INTERNAL_ERROR_CODE, e.to_string()))?
.into_iter()
.map(|pop| UserOperationV0_6::from(pop.uo).into())
.map(|pop| pop.uo.into())
.collect::<Vec<RpcUserOperation>>())
}

Expand Down
Loading

0 comments on commit a8a3ec9

Please sign in to comment.