opportunity-service 0.0.653 → 0.0.654
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,6 +22,8 @@ function registerNewUser() {
|
|
22
22
|
if (typeof msgSender == 'undefined')
|
23
23
|
throw new Error('Message sender is undefined');
|
24
24
|
const userRegistrationInstance = new ethers.Contract(userRegistrationAddress, userRegistrationInterface, opportunityService.getProviderInterface());
|
25
|
+
console.log('Checking true identificaiton of msgSender: ' + msgSender);
|
26
|
+
console.log('The true identificaiton is: ' + userRegistrationInstance.getTrueIdentification(msgSender));
|
25
27
|
if (userRegistrationInstance.getTrueIdentification(msgSender) == '0x0000000000000000000000000000000000000000') {
|
26
28
|
console.log('Registering new user: ' + msgSender);
|
27
29
|
const tx = new Contract(addressMap[opportunityService.getEthNetwork()][Contracts.USER_REGISTRATION], abiMap[Contracts.USER_REGISTRATION]).connect(opportunityService.getSignersInterface())
|
@@ -32,12 +34,18 @@ function registerNewUser() {
|
|
32
34
|
console.log('the receipt');
|
33
35
|
console.log(receipt);
|
34
36
|
if (Number(receipt.status) === 1) {
|
37
|
+
console.log('transaction succeeded');
|
35
38
|
resolve(true);
|
36
39
|
}
|
37
40
|
else {
|
41
|
+
console.log('Transaction failed');
|
38
42
|
resolve(false);
|
39
43
|
}
|
40
44
|
}
|
45
|
+
else {
|
46
|
+
console.log('User already registered');
|
47
|
+
resolve(false);
|
48
|
+
}
|
41
49
|
}
|
42
50
|
catch (error) {
|
43
51
|
console.log(error);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"register-new-user.js","sourceRoot":"","sources":["../../../src/api/identity/register-new-user.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAe,MAAM,QAAQ,CAAC;AACvD,OAAO,kBAAkB,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,UAAU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AC;qBACjB;yBAAM;wBACH,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;wBACjC,OAAO,CAAC,KAAK,CAAC,CAAA;qBACjB;iBACJ;qBAAM;oBACH,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAA;oBACtC,OAAO,CAAC,KAAK,CAAC,CAAA;iBACjB;aAGJ;YAAC,OAAM,KAAK,EAAE;gBACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBAClB,MAAM,CAAC,8DAA8D,CAAC,CAAA;aACzE;QACL,CAAC,CAAA,CAAC,CAAA;IACN,CAAC;CAAA;AAED,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
@@ -16,6 +16,10 @@ async function registerNewUser() {
|
|
16
16
|
if (typeof msgSender == 'undefined') throw new Error('Message sender is undefined')
|
17
17
|
|
18
18
|
const userRegistrationInstance = new ethers.Contract(userRegistrationAddress, userRegistrationInterface, opportunityService.getProviderInterface())
|
19
|
+
|
20
|
+
console.log('Checking true identificaiton of msgSender: ' + msgSender)
|
21
|
+
console.log('The true identificaiton is: ' + userRegistrationInstance.getTrueIdentification(msgSender))
|
22
|
+
|
19
23
|
if (userRegistrationInstance.getTrueIdentification(msgSender) == '0x0000000000000000000000000000000000000000')
|
20
24
|
{
|
21
25
|
console.log('Registering new user: ' + msgSender)
|
@@ -31,10 +35,15 @@ async function registerNewUser() {
|
|
31
35
|
console.log(receipt)
|
32
36
|
|
33
37
|
if (Number(receipt.status) === 1) {
|
38
|
+
console.log('transaction succeeded')
|
34
39
|
resolve(true);
|
35
40
|
} else {
|
41
|
+
console.log('Transaction failed')
|
36
42
|
resolve(false)
|
37
43
|
}
|
44
|
+
} else {
|
45
|
+
console.log('User already registered')
|
46
|
+
resolve(false)
|
38
47
|
}
|
39
48
|
|
40
49
|
|