Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Revert "feat(Contacts): expose uuid function for iOS to override"
Browse files Browse the repository at this point in the history
This reverts commit e0d4ecf.
  • Loading branch information
kwgithubusername committed Aug 4, 2017
1 parent e0d4ecf commit 836329b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 3 additions & 1 deletion src/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const Metadata = require('./metadata');
const assoc = require('ramda/src/assoc');
const prop = require('ramda/src/prop');
const map = require('ramda/src/map');
const uuid = require('uuid');
const FacilitatedTx = require('./facilitatedTx');

class Contact {
Expand All @@ -28,7 +29,8 @@ Contact.factory = function (o) {
return new Contact(o);
};

Contact.new = function (o, id) {
Contact.new = function (o) {
const id = uuid();
const namedContact = assoc('id', id, o);
return new Contact(namedContact);
};
Expand Down
12 changes: 4 additions & 8 deletions src/contacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,11 @@ Contacts.prototype.wipe = function () {
};

Contacts.prototype.new = function (object) {
const c = Contact.new(object, this.uuid());
const c = Contact.new(object);
this.list = R.assoc(c.id, c, this.list);
return c;
};

Contacts.prototype.uuid = function() {
return uuid();
}

const fromNull = (str) => str || '';
const isContact = (uniqueId) => R.where({id: R.equals(uniqueId)});
const contains = R.curry((substr, key) => R.where(R.objOf(key, R.compose(R.contains(substr), fromNull))));
Expand Down Expand Up @@ -221,7 +217,7 @@ const cancelResponse = function (id) {
// I want you to pay me
Contacts.prototype.sendPR = function (userId, intendedAmount, id, note, initiatorSource) {
// we should reserve the address (check buy-sell) - should probable be an argument
id = id ? id : this.uuid()
id = id ? id : uuid()
const contact = this.get(userId);
const account = initiatorSource != null ? MyWallet.wallet.hdwallet.accounts[initiatorSource] : MyWallet.wallet.hdwallet.defaultAccount;
const address = account.receiveAddress;
Expand All @@ -239,7 +235,7 @@ Contacts.prototype.sendPR = function (userId, intendedAmount, id, note, initiato

// request payment request (step-1)
Contacts.prototype.sendRPR = function (userId, intendedAmount, id, note) {
id = id ? id : this.uuid()
id = id ? id : uuid()
const message = requestPaymentRequest(intendedAmount, id, note);
const contact = this.get(userId);
return this.sendMessage(userId, REQUEST_PAYMENT_REQUEST_TYPE, message)
Expand All @@ -249,7 +245,7 @@ Contacts.prototype.sendRPR = function (userId, intendedAmount, id, note) {

// payment request response
Contacts.prototype.sendPRR = function (userId, txHash, id) {
id = id ? id : this.uuid()
id = id ? id : uuid()
const message = paymentRequestResponse(id, txHash);
const contact = this.get(userId);
return this.sendMessage(userId, PAYMENT_REQUEST_RESPONSE_TYPE, message)
Expand Down

0 comments on commit 836329b

Please sign in to comment.