-
Notifications
You must be signed in to change notification settings - Fork 130
simple account permissioning #1409
simple account permissioning #1409
Conversation
var payload = "0x1234"; | ||
|
||
contract('Permissioning: Accounts', () => { | ||
describe('Function: permissioning', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to use contract()
and describe()
https://truffleframework.com/docs/truffle/testing/writing-tests-in-javascript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -1,5 +1,7 @@ | |||
var SimplePermissioning = artifacts.require("SimplePermissioning"); | |||
var SimpleAccountPermissioning = artifacts.require("SimpleAccountPermissioning"); | |||
|
|||
module.exports = function(deployer) { | |||
deployer.deploy(SimplePermissioning); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we rename SimplePermissioning
to SimpleNodePermissioning`?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
// DO NOT USE THIS CONTRACT IN PRODUCTION APPLICATIONS | ||
|
||
contract SimpleAccountPermissioning { | ||
address[] private whitelist; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While there's no need to return the whole whitelist I think it's easier to just make this mapping(address -> boolean)
rather than do the array manipulation and looping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
…-simple-account-perm-smart-contract
…-simple-account-perm-smart-contract
permitted = await proxy.transactionAllowed(address1, address2, value, gasPrice, gasLimit, payload); | ||
assert.equal(permitted, true, 'expected tx from address1 to still be permitted'); | ||
}); | ||
it('Should NOT permit any transaction when acount whitelist is empty', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp acount
…-simple-account-perm-smart-contract
…-simple-account-perm-smart-contract
* simple account permissioning
PR description
Added SimpleAccountPermissioning smart contract with tests
Fixed Issue(s)
fixes #PAN-2608