{"size": 1201, "ext": "js", "max_stars_repo_path": "src/test/token.js", "max_stars_repo_name": "tecla5/auction", "max_stars_repo_stars_event_min_datetime": "2017-08-05T06:38:02.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-12T06:26:59.000Z", "max_issues_repo_path": "src/test/token.js", "max_issues_repo_name": "tecla5/auction", "max_issues_repo_issues_event_min_datetime": "2017-09-28T17:00:46.000Z", "max_issues_repo_issues_event_max_datetime": "2017-10-13T23:39:08.000Z", "max_forks_repo_path": "src/test/token.js", "max_forks_repo_name": "tecla5/auction", "max_forks_repo_forks_event_min_datetime": "2017-09-26T12:43:11.000Z", "max_forks_repo_forks_event_max_datetime": "2021-11-12T06:26:49.000Z"}
{"max_stars_count": 16, "max_issues_count": 30, "max_forks_count": 12, "avg_line_length": 38.7419354839, "max_line_length": 77, "alphanum_fraction": 0.6885928393}
var Token = artifacts.require("FrozenToken");

contract('token', function(accounts) {
	it("Liquid token.", function() {
		const OWNER = accounts[2];
		const PARTICIPANT = accounts[5];
		var token;
		return Token.deployed().then(function(instance) {
			token = instance;
			return token.totalSupply.call();
		}).then(function(cap) {
			assert.equal(cap.toNumber(), 10000000000, "Supply is all the tokens.");
			return token.balanceOf.call(OWNER);
		}).then(function(cap) {
			assert.equal(cap.toNumber(), 10000000000, "Owner has all the tokens.");
			token.transfer(PARTICIPANT, 10, { from: OWNER });
			return token.balanceOf.call(PARTICIPANT);
		}).then(function(balance) {
			assert.equal(balance.toNumber(), 10, "Participant has some tokens.");
			return token.transfer(OWNER, 10, { from: PARTICIPANT });
		}).then(assert.fail).catch(function(error) {
			assert.include(error.message, 'invalid opcode', 'Account is not liquid.');
			token.makeLiquid(PARTICIPANT, { from: OWNER });
			token.transfer(OWNER, 10, { from: PARTICIPANT });
			return token.balanceOf.call(PARTICIPANT);
		}).then(function(balance) {
			assert.equal(balance.toNumber(), 0, "Participant return the tokens.");
		});
	});
});
