Unverified Commit 22db1fd9 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1112 from ethereum/userdocSender

improve userdoc for sender account
parents add4c572 34058dbc
......@@ -13,7 +13,9 @@ function getFunctionFullName (signature, methodIdentifiers) {
function getOverridedSender (userdoc, signature, methodIdentifiers) {
let fullName = getFunctionFullName(signature, methodIdentifiers)
return fullName && userdoc.methods[fullName] ? userdoc.methods[fullName].notice : null
let match = /sender: account-+(\d)/g
let accountIndex = userdoc.methods[fullName] ? match.exec(userdoc.methods[fullName].notice) : null
return fullName && accountIndex ? accountIndex[1] : null
}
function getAvailableFunctions (jsonInterface) {
......
......@@ -2,25 +2,25 @@ import "remix_tests.sol"; // this import is automatically injected by Remix.
import "remix_accounts.sol";
contract SenderTest {
function beforeAll () public {}
/// 1
/// sender: account-1
function checkSenderIs1 () public {
Assert.equal(msg.sender, TestsAccounts.getAccount(1), "wrong sender in checkSenderIs1");
}
/// 0
/// sender: account-0
function checkSenderIs0 () public {
Assert.equal(msg.sender, TestsAccounts.getAccount(0), "wrong sender in checkSenderIs0");
}
/// 1
/// sender: account-1
function checkSenderIsNt0 () public {
Assert.notEqual(msg.sender, TestsAccounts.getAccount(0), "wrong sender in checkSenderIsNot0");
}
/// 2
/// sender: account-2
function checkSenderIsnt2 () public {
Assert.notEqual(msg.sender, TestsAccounts.getAccount(1), "wrong sender in checkSenderIsnt2");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment