Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
7ddd66fb
Commit
7ddd66fb
authored
Jan 16, 2018
by
AugustoL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix increaseApproval in ERC827Token with tests
parent
87f59163
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
ERC827Token.sol
contracts/token/ERC827Token.sol
+1
-1
ERC827Token.js
test/ERC827Token.js
+10
-1
No files found.
contracts/token/ERC827Token.sol
View file @
7ddd66fb
...
...
@@ -94,7 +94,7 @@ contract ERC827Token is ERC827, StandardToken {
function increaseApproval(address _spender, uint _addedValue, bytes _data) public returns (bool) {
require(_spender != address(this));
super.
approve
(_spender, _addedValue);
super.
increaseApproval
(_spender, _addedValue);
require(_spender.call(_data));
...
...
test/ERC827Token.js
View file @
7ddd66fb
...
...
@@ -183,6 +183,11 @@ contract('ERC827 Token', function (accounts) {
web3
.
toHex
(
123456
),
666
,
'Transfer Done'
);
await
token
.
approve
(
message
.
contract
.
address
,
10
);
new
BigNumber
(
10
).
should
.
be
.
bignumber
.
equal
(
await
token
.
allowance
(
accounts
[
0
],
message
.
contract
.
address
)
);
const
abiMethod
=
findMethod
(
token
.
abi
,
'increaseApproval'
,
'address,uint256,bytes'
);
const
increaseApprovalData
=
ethjsABI
.
encodeMethod
(
abiMethod
,
[
message
.
contract
.
address
,
50
,
extraData
]
...
...
@@ -193,7 +198,7 @@ contract('ERC827 Token', function (accounts) {
assert
.
equal
(
2
,
transaction
.
receipt
.
logs
.
length
);
new
BigNumber
(
5
0
).
should
.
be
.
bignumber
.
equal
(
new
BigNumber
(
6
0
).
should
.
be
.
bignumber
.
equal
(
await
token
.
allowance
(
accounts
[
0
],
message
.
contract
.
address
)
);
});
...
...
@@ -205,6 +210,10 @@ contract('ERC827 Token', function (accounts) {
await
token
.
approve
(
message
.
contract
.
address
,
100
);
new
BigNumber
(
100
).
should
.
be
.
bignumber
.
equal
(
await
token
.
allowance
(
accounts
[
0
],
message
.
contract
.
address
)
);
const
extraData
=
message
.
contract
.
showMessage
.
getData
(
web3
.
toHex
(
123456
),
666
,
'Transfer Done'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment