Compare commits

..

1 Commits

Author SHA1 Message Date
6489cc95c7
added admin functionality 2025-02-05 04:04:48 +02:00
3 changed files with 5 additions and 5 deletions

@ -196,7 +196,7 @@ message AirdropReq {
uint64 tokens = 2;
}
message Account {
message ListAccountsResp {
string pubkey = 1;
uint64 balance = 2;
uint64 tmp_locked = 3;
@ -214,5 +214,5 @@ service BrainCli {
// admin commands
rpc Airdrop (AirdropReq) returns (Empty);
rpc ListAllContracts (Empty) returns (stream Contract);
rpc ListAccounts (Empty) returns (stream Account);
rpc ListAccounts (Empty) returns (stream ListAccountsResp);
}

@ -689,10 +689,10 @@ impl BrainData {
contracts.iter().cloned().collect()
}
pub fn list_accounts(&self) -> Vec<grpc::Account> {
pub fn list_accounts(&self) -> Vec<grpc::ListAccountsResp> {
self.accounts
.iter()
.map(|a| grpc::Account {
.map(|a| grpc::ListAccountsResp {
pubkey: a.key().to_string(),
balance: a.balance,
tmp_locked: a.tmp_locked,

@ -300,7 +300,7 @@ impl BrainCli for BrainCliMock {
))
}
type ListAccountsStream = Pin<Box<dyn Stream<Item = Result<Account, Status>> + Send>>;
type ListAccountsStream = Pin<Box<dyn Stream<Item = Result<ListAccountsResp, Status>> + Send>>;
async fn list_accounts(
&self,
req: Request<Empty>,