Skip to content

Commit

Permalink
Added prototype for transfer rpc call
Browse files Browse the repository at this point in the history
  • Loading branch information
EDDragonWolf committed Jan 24, 2018
1 parent 57f8dc4 commit dea5e6e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/supernode/baseclientproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ bool supernode::BaseClientProxy::RestoreAccount(const supernode::rpc_command::RE
return true;
}

bool supernode::BaseClientProxy::Transfer(const supernode::rpc_command::TRANSFER::request &in, supernode::rpc_command::TRANSFER::response &out)
{
out.Result = ERROR_NOT_ENOUGH_COINS;
return true;
}

std::unique_ptr<tools::GraftWallet> supernode::BaseClientProxy::initWallet(const string &account, const string &password) const
{
std::unique_ptr<tools::GraftWallet> wal;
Expand Down
1 change: 1 addition & 0 deletions src/supernode/baseclientproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class BaseClientProxy : public BaseRTAProcessor
bool GetSeed(const rpc_command::GET_SEED::request &in, rpc_command::GET_SEED::response &out);
bool RestoreAccount(const rpc_command::RESTORE_ACCOUNT::request &in, rpc_command::RESTORE_ACCOUNT::response &out);

bool Transfer(const rpc_command::TRANSFER::request &in, rpc_command::TRANSFER::response &out);

protected:

Expand Down
2 changes: 2 additions & 0 deletions src/supernode/graft_defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@
#define ERROR_BALANCE_NOT_AVAILABLE -16
#define ERROR_CANNOT_REJECT_PAY -17

#define ERROR_NOT_ENOUGH_COINS -20


#endif // GRAFT_DEFINES_H
23 changes: 23 additions & 0 deletions src/supernode/supernode_rpc_command.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,29 @@ namespace supernode {
};
};

struct TRANSFER {
struct request {
std::string Account;
std::string Password;
std::string Address;
std::string Amount;

BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(Account)
KV_SERIALIZE(Password)
KV_SERIALIZE(Address)
KV_SERIALIZE(Amount)
END_KV_SERIALIZE_MAP()
};
struct response {
int64_t Result;

BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(Result)
END_KV_SERIALIZE_MAP()
};
};

void ConvertFromTR(RTA_TransactionRecordRequest& dst, const RTA_TransactionRecord& src);

void ConvertToTR(RTA_TransactionRecord& dst, const RTA_TransactionRecordRequest& src, const FSN_ServantBase* servant);
Expand Down

0 comments on commit dea5e6e

Please sign in to comment.