-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDSO.js
37 lines (32 loc) · 1.21 KB
/
DSO.js
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
/*
* StromDAO Business Object: DSO
* =========================================
* Distribution Service Operator / logistical handling for StromDAO Energy Blockchain.
*
* @author Thorsten Zoerner thorsten.zoerner@stromdao.de
*
*/
this.dso=function(obj_or_address) {
if(typeof obj_or_address == "undefined") obj_or_address=parent.options.contracts["StromDAO-BO.sol_DSO"];
var p1 = new Promise(function(resolve, reject) {
var instance=parent._objInstance(obj_or_address,'StromDAO-BO.sol_DSO');
instance.approveConnection=function(address_meterpoint,uint256_powerlimit) {
var p2 = new Promise(function(resolve2, reject2) {
instance.obj.approveConnection(address_meterpoint,uint256_powerlimit).then(function(o) {
parent._waitForTransactionKeepRef(o,resolve2);
});
});
return p2;
};
instance.approvedConnections=function(address_meterpoint) {
var p2 = new Promise(function(resolve2, reject2) {
instance.obj.approvedConnections(address_meterpoint).then(function(o) {
resolve2(o);
});
});
return p2;
}
resolve(instance);
});
return p1;
};