Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
rename DNC to DFC
Browse files Browse the repository at this point in the history
  • Loading branch information
canonbrother committed Sep 28, 2022
1 parent 90e5b28 commit 5352280
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions meta/meta-consensus/rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ use serde::{Deserialize, Serialize};
mod tests;

#[derive(Debug, Default, Serialize, Deserialize)]
pub struct DNCTx {
pub struct DFCTx {
from: String,
to: String,
amount: i64,
signature: String,
}

// NOTE(surangap): keeping DMCTx as separate struct from DNCTx for now
// NOTE(surangap): keeping DMCTx as separate struct from DFCTx for now
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct DMCTx {
from: String,
Expand All @@ -55,13 +55,13 @@ where
fn get_block(&self, at: Option<NumberFor<Block>>) -> RpcResult<Vec<u8>>;

#[method(name = "metaConsensusRpc_mintBlock")]
async fn mint_block(&self, dnc_txs: Vec<DNCTx>) -> RpcResult<(Vec<u8>, Vec<DMCTx>)>;
async fn mint_block(&self, dfc_txs: Vec<DFCTx>) -> RpcResult<(Vec<u8>, Vec<DMCTx>)>;

#[method(name = "metaConsensusRpc_connectBlock")]
async fn connect_block(
&self,
dmc_payload: Vec<u8>,
dnc_txs: Vec<DNCTx>,
dfc_txs: Vec<DFCTx>,
) -> RpcResult<(bool, Vec<DMCTx>)>;
}

Expand Down Expand Up @@ -135,8 +135,8 @@ where
}
}

async fn mint_block(&self, dnc_txs: Vec<DNCTx>) -> RpcResult<(Vec<u8>, Vec<DMCTx>)> {
//TODO(surangap): validate the dnc_txs. do the account balance changes accordingly
async fn mint_block(&self, dfc_txs: Vec<DFCTx>) -> RpcResult<(Vec<u8>, Vec<DMCTx>)> {
//TODO(surangap): validate the dfc_txs. do the account balance changes accordingly

// send command to mint the next block
let sink = self.command_sink.clone();
Expand Down Expand Up @@ -171,7 +171,7 @@ where
async fn connect_block(
&self,
dmc_payload: Vec<u8>,
dnc_txs: Vec<DNCTx>,
dfc_txs: Vec<DFCTx>,
) -> RpcResult<(bool, Vec<DMCTx>)> {
// decode the signed block
let decoded = SignedBlock::decode(&mut &dmc_payload[..]);
Expand Down

0 comments on commit 5352280

Please sign in to comment.