1
0
Fork 0
forked from lthn/blockchain

fix error when buyer deposit is smaller than amount

This commit is contained in:
wildkif 2019-05-28 15:04:10 +03:00
parent 290460c0f3
commit 8cfe21421a
7 changed files with 3 additions and 11 deletions

View file

@ -352,7 +352,6 @@
},
"BUYER": {
"WAITING": "Waiting for response",
"PLEDGE_RESERVED": "Pledge amount reserved",
"IGNORED": "The seller ignored your contract proposal",
"ACCEPTED": "The seller accepted your contract proposal",
"WAIT": "Waiting for deposits confirmation",

View file

@ -1048,7 +1048,6 @@ var Wallet = /** @class */ (function () {
}
var searchResult = viewedContracts.some(function (elem) { return elem.state === contract.state && elem.is_a === contract.is_a && elem.contract_id === contract.contract_id; });
contract.is_new = !searchResult;
contract['private_detailes'].a_pledge = contract['private_detailes'].a_pledge.plus(contract['private_detailes'].to_pay);
wallet.contracts.push(contract);
};
for (var i = 0; i < items.length; i++) {
@ -1979,7 +1978,7 @@ var BackendService = /** @class */ (function () {
a_addr: a_addr,
b_addr: b_addr,
to_pay: this.moneyToIntPipe.transform(to_pay),
a_pledge: this.moneyToIntPipe.transform((new bignumber_js__WEBPACK_IMPORTED_MODULE_7__["BigNumber"](a_pledge)).minus(to_pay).toString()),
a_pledge: this.moneyToIntPipe.transform(a_pledge),
b_pledge: this.moneyToIntPipe.transform(b_pledge)
},
payment_id: payment_id,
@ -3023,7 +3022,6 @@ var AppComponent = /** @class */ (function () {
}
var searchResult = _this.variablesService.settings.viewedContracts.some(function (elem) { return elem.state === contract_1.state && elem.is_a === contract_1.is_a && elem.contract_id === contract_1.contract_id; });
contract_1.is_new = !searchResult;
contract_1['private_detailes'].a_pledge = contract_1['private_detailes'].a_pledge.plus(contract_1['private_detailes'].to_pay);
var findContract = false;
for (var i = 0; i < wallet.contracts.length; i++) {
if (wallet.contracts[i].contract_id === contract_1.contract_id && wallet.contracts[i].is_a === contract_1.is_a) {

File diff suppressed because one or more lines are too long

View file

@ -214,8 +214,6 @@ export class Wallet {
const searchResult = viewedContracts.some(elem => elem.state === contract.state && elem.is_a === contract.is_a && elem.contract_id === contract.contract_id);
contract.is_new = !searchResult;
contract['private_detailes'].a_pledge = contract['private_detailes'].a_pledge.plus(contract['private_detailes'].to_pay);
wallet.contracts.push(contract);
}
this.recountNewContracts();

View file

@ -426,7 +426,7 @@ export class BackendService {
a_addr: a_addr,
b_addr: b_addr,
to_pay: this.moneyToIntPipe.transform(to_pay),
a_pledge: this.moneyToIntPipe.transform((new BigNumber(a_pledge)).minus(to_pay).toString()),
a_pledge: this.moneyToIntPipe.transform(a_pledge),
b_pledge: this.moneyToIntPipe.transform(b_pledge)
},
payment_id: payment_id,

View file

@ -317,8 +317,6 @@ export class AppComponent implements OnInit, OnDestroy {
const searchResult = this.variablesService.settings.viewedContracts.some(elem => elem.state === contract.state && elem.is_a === contract.is_a && elem.contract_id === contract.contract_id);
contract.is_new = !searchResult;
contract['private_detailes'].a_pledge = contract['private_detailes'].a_pledge.plus(contract['private_detailes'].to_pay);
let findContract = false;
for (let i = 0; i < wallet.contracts.length; i++) {
if (wallet.contracts[i].contract_id === contract.contract_id && wallet.contracts[i].is_a === contract.is_a) {

View file

@ -352,7 +352,6 @@
},
"BUYER": {
"WAITING": "Waiting for response",
"PLEDGE_RESERVED": "Pledge amount reserved",
"IGNORED": "The seller ignored your contract proposal",
"ACCEPTED": "The seller accepted your contract proposal",
"WAIT": "Waiting for deposits confirmation",