Explorar o código

bin/dao: delete init() rpc method

Dastan-glitch %!s(int64=3) %!d(string=hai) anos
pai
achega
4b824d67d9
Modificáronse 3 ficheiros con 0 adicións e 20 borrados
  1. 0 7
      bin/dao/dao-cli/src/main.rs
  2. 0 7
      bin/dao/dao-cli/src/rpc.rs
  3. 0 6
      bin/dao/daod/src/rpc.rs

+ 0 - 7
bin/dao/dao-cli/src/main.rs

@@ -7,8 +7,6 @@ mod rpc;
 
 #[derive(Subcommand)]
 pub enum CliDaoSubCommands {
-    /// Initialize DAO
-    Init {},
     /// Create DAO
     Create {},
     /// Airdrop tokens
@@ -41,11 +39,6 @@ async fn start(options: CliDao) -> Result<()> {
     let rpc_addr = "tcp://127.0.0.1:7777";
     let client = Rpc { client: RpcClient::new(Url::parse(rpc_addr)?).await? };
     match options.command {
-        Some(CliDaoSubCommands::Init {}) => {
-            let reply = client.init().await?;
-            println!("Server replied: {}", &reply.to_string());
-            return Ok(())
-        }
         Some(CliDaoSubCommands::Create {}) => {
             let reply = client.create().await?;
             println!("Server replied: {}", &reply.to_string());

+ 0 - 7
bin/dao/dao-cli/src/rpc.rs

@@ -5,13 +5,6 @@ use darkfi::{rpc::jsonrpc::JsonRequest, Result};
 use crate::Rpc;
 
 impl Rpc {
-    // --> {"jsonrpc": "2.0", "method": "init", "params": [], "id": 42}
-    // <-- {"jsonrpc": "2.0", "result": "initializing...", "id": 42}
-    pub async fn init(&self) -> Result<Value> {
-        let req = JsonRequest::new("init", json!([]));
-        self.client.request(req).await
-    }
-
     // --> {"jsonrpc": "2.0", "method": "create", "params": [], "id": 42}
     // <-- {"jsonrpc": "2.0", "result": "creating dao...", "id": 42}
     pub async fn create(&self) -> Result<Value> {

+ 0 - 6
bin/dao/daod/src/rpc.rs

@@ -19,7 +19,6 @@ impl RequestHandler for JsonRpcInterface {
         debug!(target: "RPC", "--> {}", serde_json::to_string(&req).unwrap());
 
         match req.method.as_str() {
-            Some("init") => return self.init(req.id, req.params).await,
             Some("create") => return self.create_dao(req.id, req.params).await,
             Some("airdrop") => return self.airdrop_tokens(req.id, req.params).await,
             Some("propose") => return self.create_proposal(req.id, req.params).await,
@@ -31,11 +30,6 @@ impl RequestHandler for JsonRpcInterface {
 }
 
 impl JsonRpcInterface {
-    // --> {"method": "init", "params": []}
-    // <-- {"result": "initializeing..."}
-    async fn init(&self, id: Value, _params: Value) -> JsonResult {
-        JsonResponse::new(json!("initializeing..."), id).into()
-    }
     // --> {"method": "create", "params": []}
     // <-- {"result": "creating dao..."}
     async fn create_dao(&self, id: Value, _params: Value) -> JsonResult {