Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge 56d5b0d into 91c2526
Browse files Browse the repository at this point in the history
  • Loading branch information
littleskunk committed Jan 17, 2018
2 parents 91c2526 + 56d5b0d commit e7f402a
Showing 1 changed file with 55 additions and 2 deletions.
57 changes: 55 additions & 2 deletions test/client.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,38 @@ describe('Client', function() {
]);
});

it('publishContract', function() {
var client = complex.createClient();
var method = 'publishContract';
var contract = new storj.Contract();
var farmer = storj.Contact({
address: '127.0.0.1',
port: 3030
});
var args = [farmer, contract];
var result = client._serializeRequestArguments(method, args);
expect(result).to.deep.equal([
farmer,
{
audit_count: 10,
data_hash: null,
data_size: 1234,
farmer_id: null,
farmer_signature: null,
payment_destination: null,
payment_download_price: 0,
payment_storage_price: 0,
renter_hd_index: false,
renter_hd_key: false,
renter_id: null,
renter_signature: null,
store_begin: 2000000000,
store_end: 3000000000,
version: 0
}
]);
});

it('getStorageProof', function() {
var client = complex.createClient();
var method = 'getStorageProof';
Expand Down Expand Up @@ -431,8 +463,29 @@ describe('Client', function() {
it('getMirrorNodes', function() {
var client = complex.createClient();
var method = 'getMirrorNodes';
var args = [];
client._serializeRequestArguments(method, args);
var farmer = new storj.Contact({
address: '127.0.0.1',
port: 3030
});
var args = [
farmer
];
var result = client._serializeRequestArguments(method, args);
expect(result).to.equal(args);
});

it('ping', function() {
var client = complex.createClient();
var method = 'ping';
var farmer = new storj.Contact({
address: '127.0.0.1',
port: 3030
});
var args = [
farmer
];
var result = client._serializeRequestArguments(method, args);
expect(result).to.equal(args);
});
});

Expand Down

0 comments on commit e7f402a

Please sign in to comment.