Skip to content

Commit 03e1aa4

Browse files
committed
remove useless schemaid related code
1 parent 379258e commit 03e1aa4

5 files changed

Lines changed: 4 additions & 53 deletions

File tree

src/connect.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ Connection.prototype.useCert = function(cert) {
1717
this.userCert = cert;
1818
}
1919

20-
Connection.prototype.setSchema = function(schemaID) {
21-
this.schemaID = schemaID;
22-
}
23-
2420
Connection.prototype.connect = function() {
2521
let that = this;
2622
return new Promise(function(resolve, reject) {

src/eventManager.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,10 @@ EventManager.prototype.subscribeTable = function(owner, name, cb) {
2828
};
2929
EventManager.prototype.subscribeTx = function(id, cb) {
3030
var that = this;
31-
32-
var schema_id = ""
33-
if(that.chainsql.connect.schemaID !=undefined){
34-
schema_id = that.chainsql.connect.schemaID
35-
}
36-
31+
3732
var messageTx = {
3833
"command": "subscribe",
3934
"transaction": id,
40-
schema_id: schema_id,
4135
};
4236
if (!that.onMessage) {
4337
_onMessage(that);

src/index.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,21 +1254,6 @@ ChainsqlAPI.prototype.modifySchema = function(schemaInfo){
12541254
throw new Error("Invalid modifySchema parameter");
12551255
}
12561256

1257-
// var validators = []
1258-
// var i = 0
1259-
// var len = schemaInfo.Validators.length
1260-
1261-
// for(; i < len; i++) {
1262-
// var hexValidator = convertStringToHex(schemaInfo.Validators[i].Validator.PublicKey)
1263-
1264-
// var item = {
1265-
// Validator:{
1266-
// PublicKey:hexValidator
1267-
// }
1268-
// }
1269-
// validators.push(item)
1270-
// }
1271-
12721257
var peerlists = []
12731258
var i = 0;
12741259
var len = schemaInfo.PeerList.length
@@ -1303,25 +1288,6 @@ ChainsqlAPI.prototype.modifySchema = function(schemaInfo){
13031288

13041289
// 修改子链
13051290
this.schemaModifyTx = true;
1306-
1307-
// let payment = {
1308-
// Account: that.connect.address,
1309-
// SchemaID:"595FC1AA0C73D735C3362A0E9976A64E024C86976E08C02D299DB344CF674650",
1310-
// OpType: 1,
1311-
// Validators:[
1312-
// {
1313-
// Validator:{PublicKey:"02BD87A95F549ECF607D6AE3AEC4C95D0BFF0F49309B4E7A9F15B842EB62A8ED1A"}
1314-
// }
1315-
// ],
1316-
// PeerList:[
1317-
// {
1318-
// Peer:{ Endpoint:convertStringToHex("192.168.29.116:7017") }
1319-
// }
1320-
1321-
// ],
1322-
// TransactionType: 'SchemaModify'
1323-
// };
1324-
13251291
this.payment = schemaModifyTxJson;
13261292
return this;
13271293

src/ripple.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,6 @@ Ripple.prototype.prepareJson = function () {
7474
}
7575
}
7676

77-
//self.connect
78-
79-
if(self.ChainsqlAPI.connect.schemaID != undefined){
80-
self.ChainsqlAPI.api.schemaID = self.ChainsqlAPI.connect.schemaID;
81-
}
82-
8377
self.ChainsqlAPI.api.preparePayment(self.ChainsqlAPI.connect.address, txJson, instructions)
8478
.then(function (data) {
8579
resolve(data);

test/testRipple.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ var sCurrency = "aaa"
3939
main();
4040
async function main() {
4141
// let res = await c.connect('ws://101.201.40.124:5006');
42-
let res = await c.connect('ws://127.0.0.1:6006');
42+
let res = await c.connect('ws://192.168.29.69:6305');
43+
await c.setSchema("8B0BA6D8848C76E19433EE90E2A88210E403339F2C5AC750271EFC862A173894");
4344

4445
c.as(root);
4546
c.setRestrict(true);
4647
/**************************************/
47-
let nStep = tagStep.escrow;
48+
let nStep = tagStep.gateWay;
4849
switch (nStep) {
4950
case tagStep.active: testActive(); break;// 激活若干账户
5051
case tagStep.gateWay: testGateWay(); break;//部署网管,信任,发行币转账

0 commit comments

Comments
 (0)