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
de99e7bf
Commit
de99e7bf
authored
Jun 29, 2017
by
Rudy Godoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent DRY
parent
549590d1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
PullPayment.js
test/PullPayment.js
+7
-7
No files found.
test/PullPayment.js
View file @
de99e7bf
var
PullPaymentMock
=
artifacts
.
require
(
"./helpers/PullPaymentMock.sol"
);
contract
(
'PullPayment'
,
function
(
accounts
)
{
let
ppce
;
let
tAMOUNT
=
17
*
1
e18
;
beforeEach
(
async
function
()
{
ppce
=
await
PullPaymentMock
.
new
({
value
:
tAMOUNT
});
});
it
(
"can't call asyncSend externally"
,
async
function
()
{
let
ppc
=
await
PullPaymentMock
.
new
();
assert
.
isUndefined
(
ppc
.
asyncSend
);
assert
.
isUndefined
(
ppce
.
asyncSend
);
});
it
(
"can record an async payment correctly"
,
async
function
()
{
let
AMOUNT
=
100
;
let
ppce
=
await
PullPaymentMock
.
new
();
let
callSend
=
await
ppce
.
callSend
(
accounts
[
0
],
AMOUNT
);
let
paymentsToAccount0
=
await
ppce
.
payments
(
accounts
[
0
]);
let
totalPayments
=
await
ppce
.
totalPayments
();
...
...
@@ -19,7 +23,6 @@ contract('PullPayment', function(accounts) {
});
it
(
"can add multiple balances on one account"
,
async
function
()
{
let
ppce
=
await
PullPaymentMock
.
new
();
let
call1
=
await
ppce
.
callSend
(
accounts
[
0
],
200
);
let
call2
=
await
ppce
.
callSend
(
accounts
[
0
],
300
);
let
paymentsToAccount0
=
await
ppce
.
payments
(
accounts
[
0
]);
...
...
@@ -30,7 +33,6 @@ contract('PullPayment', function(accounts) {
});
it
(
"can add balances on multiple accounts"
,
async
function
()
{
let
ppce
=
await
PullPaymentMock
.
new
();
let
call1
=
await
ppce
.
callSend
(
accounts
[
0
],
200
);
let
call2
=
await
ppce
.
callSend
(
accounts
[
1
],
300
);
...
...
@@ -45,11 +47,9 @@ contract('PullPayment', function(accounts) {
});
it
(
"can withdraw payment"
,
async
function
()
{
let
AMOUNT
=
17
*
1
e18
;
let
payee
=
accounts
[
1
];
let
initialBalance
=
web3
.
eth
.
getBalance
(
payee
);
let
ppce
=
await
PullPaymentMock
.
new
({
value
:
AMOUNT
});
let
call1
=
await
ppce
.
callSend
(
payee
,
AMOUNT
);
let
payment1
=
await
ppce
.
payments
(
payee
);
...
...
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