diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-20 19:41:50 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-20 21:23:37 +0800 |
commit | 81e9c679c4d2d10a2ac2a7d82e25d5e9691c2b45 (patch) | |
tree | 2ba0ff0ecada1bee77bc9f92ebecf17774f2af42 /test/RPCSession.cpp | |
parent | bdd2858bfd6bb5b880797a5984e212c4b63d9e04 (diff) | |
download | dexon-solidity-81e9c679c4d2d10a2ac2a7d82e25d5e9691c2b45.tar.gz dexon-solidity-81e9c679c4d2d10a2ac2a7d82e25d5e9691c2b45.tar.zst dexon-solidity-81e9c679c4d2d10a2ac2a7d82e25d5e9691c2b45.zip |
Add helper RPCSession::createAccount
Diffstat (limited to 'test/RPCSession.cpp')
-rw-r--r-- | test/RPCSession.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/test/RPCSession.cpp b/test/RPCSession.cpp index 634954a3..b99c1c06 100644 --- a/test/RPCSession.cpp +++ b/test/RPCSession.cpp @@ -339,22 +339,25 @@ Json::Value RPCSession::rpcCall(string const& _methodName, vector<string> const& return result["result"]; } +string const& RPCSession::accountCreate() +{ + m_accounts.push_back(personal_newAccount("")); + personal_unlockAccount(m_accounts.back(), "", 100000); + return m_accounts.back(); +} + string const& RPCSession::accountCreateIfNotExists(size_t _id) { if (_id >= m_accounts.size()) - { - m_accounts.push_back(personal_newAccount("")); - personal_unlockAccount(m_accounts.back(), "", 100000); - } + accountCreate(); return m_accounts[_id]; } RPCSession::RPCSession(const string& _path): m_ipcSocket(_path) { - string account = personal_newAccount(""); - personal_unlockAccount(account, "", 100000); - m_accounts.push_back(account); + accountCreate(); + // This will pre-fund the accounts create prior. test_setChainParams(m_accounts); } |