-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MarketJob Factory && array of services into Job struct
- Loading branch information
Showing
7 changed files
with
86 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
pragma solidity ^0.4.15; | ||
|
||
import './MarketJob.sol'; | ||
|
||
|
||
contract MarketJobFactory { | ||
|
||
function create( | ||
address[] agents, | ||
uint256[] amounts, | ||
uint256[] services, | ||
address payer, | ||
bytes firstPacket) public returns (MarketJob) | ||
{ | ||
return new MarketJob(agents,amounts,services,payer,firstPacket); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const Factory = artifacts.require('market/MarketJobFactory.sol') | ||
|
||
contract('Market Job Factory', function (accounts) { | ||
let factory | ||
|
||
beforeEach(async () => { | ||
factory = await Factory.new() | ||
}) | ||
// master agent: accounts[0] | ||
it('verifies that someone can create a market job', async () => { | ||
const marketJob = await factory.create( | ||
[accounts[0]], // agents | ||
[100], // amounts | ||
[12300], //id service | ||
accounts[1], // payer address | ||
"0x0" // first packet ) | ||
) | ||
|
||
assert.isNotNull(marketJob) | ||
}) | ||
|
||
|
||
}) |