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 84dfae0 commit 920424b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 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, dnc_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>,
dnc_txs: Vec<DFCTx>,
) -> RpcResult<(bool, Vec<DMCTx>)>;
}

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

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

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

0 comments on commit 920424b

Please sign in to comment.