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
f8e6a13d
Commit
f8e6a13d
authored
Aug 16, 2016
by
Manuel Araoz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove metacoin test
parent
0241046e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
57 deletions
+0
-57
metacoin.js
test/metacoin.js
+0
-57
No files found.
test/metacoin.js
deleted
100644 → 0
View file @
0241046e
contract
(
'MetaCoin'
,
function
(
accounts
)
{
it
(
"should put 10000 MetaCoin in the first account"
,
function
()
{
var
meta
=
MetaCoin
.
deployed
();
return
meta
.
getBalance
.
call
(
accounts
[
0
]).
then
(
function
(
balance
)
{
assert
.
equal
(
balance
.
valueOf
(),
10000
,
"10000 wasn't in the first account"
);
});
});
it
(
"should call a function that depends on a linked library "
,
function
(){
var
meta
=
MetaCoin
.
deployed
();
var
metaCoinBalance
;
var
metaCoinEthBalance
;
return
meta
.
getBalance
.
call
(
accounts
[
0
]).
then
(
function
(
outCoinBalance
){
metaCoinBalance
=
outCoinBalance
.
toNumber
();
return
meta
.
getBalanceInEth
.
call
(
accounts
[
0
]);
}).
then
(
function
(
outCoinBalanceEth
){
metaCoinEthBalance
=
outCoinBalanceEth
.
toNumber
();
}).
then
(
function
(){
assert
.
equal
(
metaCoinEthBalance
,
2
*
metaCoinBalance
,
"Library function returned unexpeced function, linkage may be broken"
);
});
});
it
(
"should send coin correctly"
,
function
()
{
var
meta
=
MetaCoin
.
deployed
();
// Get initial balances of first and second account.
var
account_one
=
accounts
[
0
];
var
account_two
=
accounts
[
1
];
var
account_one_starting_balance
;
var
account_two_starting_balance
;
var
account_one_ending_balance
;
var
account_two_ending_balance
;
var
amount
=
10
;
return
meta
.
getBalance
.
call
(
account_one
).
then
(
function
(
balance
)
{
account_one_starting_balance
=
balance
.
toNumber
();
return
meta
.
getBalance
.
call
(
account_two
);
}).
then
(
function
(
balance
)
{
account_two_starting_balance
=
balance
.
toNumber
();
return
meta
.
sendCoin
(
account_two
,
amount
,
{
from
:
account_one
});
}).
then
(
function
()
{
return
meta
.
getBalance
.
call
(
account_one
);
}).
then
(
function
(
balance
)
{
account_one_ending_balance
=
balance
.
toNumber
();
return
meta
.
getBalance
.
call
(
account_two
);
}).
then
(
function
(
balance
)
{
account_two_ending_balance
=
balance
.
toNumber
();
assert
.
equal
(
account_one_ending_balance
,
account_one_starting_balance
-
amount
,
"Amount wasn't correctly taken from the sender"
);
assert
.
equal
(
account_two_ending_balance
,
account_two_starting_balance
+
amount
,
"Amount wasn't correctly sent to the receiver"
);
});
});
});
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