forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransactionInfo.ts
63 lines (58 loc) · 1.87 KB
/
TransactionInfo.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
* Copyright 2020-2021 Hyperledger Cactus Contributors
* SPDX-License-Identifier: Apache-2.0
*
* TransactionInfo.ts
*/
import { RequestInfo } from "../../packages/cactus-cmd-socketio-server/src/main/typescript/routing-interface/RequestInfo";
export class TransactionInfo {
businessLogicID: string;
tradeID: string;
ethereumAccountFrom: string;
ethereumAccountTo: string;
ethereumAccountFromKey: string;
ethereumAccountToKey: string;
fabricAccountFrom: string;
fabricAccountTo: string;
fabricAccountFromKey: string;
fabricAccountToKey: string;
tradingValue: string;
carID: string;
status: number;
escrowLedger: string;
escrowTxID: string;
escrowTxInfo: string;
transferLedger: string;
transferTxID: string;
transferTxInfo: string;
settlementLedger: string;
settlementTxID: string;
settlementTxInfo: string;
constructor() {}
setRequestInfo(mode: number, requestInfo: RequestInfo) {
// Set request information
this.businessLogicID = requestInfo.businessLogicID;
this.tradeID = requestInfo.tradeID;
this.ethereumAccountFrom = requestInfo.tradeInfo.ethereumAccountFrom;
this.ethereumAccountTo = requestInfo.tradeInfo.ethereumAccountTo;
this.fabricAccountFrom = requestInfo.tradeInfo.fabricAccountFrom;
this.fabricAccountTo = requestInfo.tradeInfo.fabricAccountTo;
this.tradingValue = requestInfo.tradeInfo.tradingValue;
this.carID = requestInfo.tradeInfo.carID;
// mode check
if (mode === 0) {
// init mode
// Initialize anything other than request information
this.status = null;
this.escrowLedger = null;
this.escrowTxID = null;
this.escrowTxInfo = null;
this.transferLedger = null;
this.transferTxID = null;
this.transferTxInfo = null;
this.settlementLedger = null;
this.settlementTxID = null;
this.settlementTxInfo = null;
}
}
}