Skip to content

Commit

Permalink
Merge pull request #192 from TRON-US/BTFS-3753-version-distribution
Browse files Browse the repository at this point in the history
Btfs 3753 version distribution
  • Loading branch information
laocheng-cheng authored Feb 18, 2022
2 parents 933e98f + 463abce commit 4bce40f
Show file tree
Hide file tree
Showing 6 changed files with 1,326 additions and 295 deletions.
298 changes: 297 additions & 1 deletion js/protos/node/node_pb.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ goog.exportSymbol('proto.node.Node', null, global);
goog.exportSymbol('proto.node.Node.ExperimentalFlags', null, global);
goog.exportSymbol('proto.node.Node.Geo', null, global);
goog.exportSymbol('proto.node.Node.Settings', null, global);
goog.exportSymbol('proto.node.NodeContractStat', null, global);
goog.exportSymbol('proto.node.NodeRole', null, global);
goog.exportSymbol('proto.node.PayLoadInfo', null, global);
goog.exportSymbol('proto.node.ScoreHistoryTab', null, global);
Expand Down Expand Up @@ -185,6 +186,27 @@ if (goog.DEBUG && !COMPILED) {
*/
proto.node.Node.ExperimentalFlags.displayName = 'proto.node.Node.ExperimentalFlags';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.node.NodeContractStat = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.node.NodeContractStat, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.node.NodeContractStat.displayName = 'proto.node.NodeContractStat';
}
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
Expand Down Expand Up @@ -3581,6 +3603,247 @@ proto.node.Node.prototype.hasFlg = function() {



if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.node.NodeContractStat.prototype.toObject = function(opt_includeInstance) {
return proto.node.NodeContractStat.toObject(opt_includeInstance, this);
};


/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.node.NodeContractStat} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.node.NodeContractStat.toObject = function(includeInstance, msg) {
var f, obj = {
tableName: jspb.Message.getFieldWithDefault(msg, 1, ""),
nodeId: jspb.Message.getFieldWithDefault(msg, 2, ""),
bigMiner: jspb.Message.getBooleanFieldWithDefault(msg, 3, false),
lastModifyTime: (f = msg.getLastModifyTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
};

if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}


/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.node.NodeContractStat}
*/
proto.node.NodeContractStat.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.node.NodeContractStat;
return proto.node.NodeContractStat.deserializeBinaryFromReader(msg, reader);
};


/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.node.NodeContractStat} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.node.NodeContractStat}
*/
proto.node.NodeContractStat.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setTableName(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setNodeId(value);
break;
case 3:
var value = /** @type {boolean} */ (reader.readBool());
msg.setBigMiner(value);
break;
case 4:
var value = new google_protobuf_timestamp_pb.Timestamp;
reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
msg.setLastModifyTime(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};


/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.node.NodeContractStat.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.node.NodeContractStat.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};


/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.node.NodeContractStat} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.node.NodeContractStat.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTableName();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getNodeId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getBigMiner();
if (f) {
writer.writeBool(
3,
f
);
}
f = message.getLastModifyTime();
if (f != null) {
writer.writeMessage(
4,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
};


/**
* optional string table_name = 1;
* @return {string}
*/
proto.node.NodeContractStat.prototype.getTableName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
* @param {string} value
* @return {!proto.node.NodeContractStat} returns this
*/
proto.node.NodeContractStat.prototype.setTableName = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};


/**
* optional string node_id = 2;
* @return {string}
*/
proto.node.NodeContractStat.prototype.getNodeId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
* @param {string} value
* @return {!proto.node.NodeContractStat} returns this
*/
proto.node.NodeContractStat.prototype.setNodeId = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};


/**
* optional bool big_miner = 3;
* @return {boolean}
*/
proto.node.NodeContractStat.prototype.getBigMiner = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
};


/**
* @param {boolean} value
* @return {!proto.node.NodeContractStat} returns this
*/
proto.node.NodeContractStat.prototype.setBigMiner = function(value) {
return jspb.Message.setProto3BooleanField(this, 3, value);
};


/**
* optional google.protobuf.Timestamp last_modify_time = 4;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.node.NodeContractStat.prototype.getLastModifyTime = function() {
return /** @type{?proto.google.protobuf.Timestamp} */ (
jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 4));
};


/**
* @param {?proto.google.protobuf.Timestamp|undefined} value
* @return {!proto.node.NodeContractStat} returns this
*/
proto.node.NodeContractStat.prototype.setLastModifyTime = function(value) {
return jspb.Message.setWrapperField(this, 4, value);
};


/**
* Clears the message field making it undefined.
* @return {!proto.node.NodeContractStat} returns this
*/
proto.node.NodeContractStat.prototype.clearLastModifyTime = function() {
return this.setLastModifyTime(undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.node.NodeContractStat.prototype.hasLastModifyTime = function() {
return jspb.Message.getField(this, 4) != null;
};





if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
Expand Down Expand Up @@ -5929,7 +6192,8 @@ proto.node.BtfsScanTab.toObject = function(includeInstance, msg) {
newOnlineMinersCount: jspb.Message.getFieldWithDefault(msg, 18, 0),
minersAllAmount: jspb.Message.getFieldWithDefault(msg, 19, 0),
totalMiners: jspb.Message.getFieldWithDefault(msg, 20, 0),
bigMiners: jspb.Message.getFieldWithDefault(msg, 21, 0)
bigMiners: jspb.Message.getFieldWithDefault(msg, 21, 0),
versionDistributeMap: (f = msg.getVersionDistributeMap()) ? f.toObject(includeInstance, undefined) : []
};

if (includeInstance) {
Expand Down Expand Up @@ -6056,6 +6320,12 @@ proto.node.BtfsScanTab.deserializeBinaryFromReader = function(msg, reader) {
var value = /** @type {number} */ (reader.readInt64());
msg.setBigMiners(value);
break;
case 22:
var value = msg.getVersionDistributeMap();
reader.readMessage(value, function(message, reader) {
jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readString, jspb.BinaryReader.prototype.readInt32, null, "", 0);
});
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -6228,6 +6498,10 @@ proto.node.BtfsScanTab.serializeBinaryToWriter = function(message, writer) {
f
);
}
f = message.getVersionDistributeMap(true);
if (f && f.getLength() > 0) {
f.serializeBinary(22, writer, jspb.BinaryWriter.prototype.writeString, jspb.BinaryWriter.prototype.writeInt32);
}
};


Expand Down Expand Up @@ -6655,6 +6929,28 @@ proto.node.BtfsScanTab.prototype.setBigMiners = function(value) {
};


/**
* map<string, int32> version_distribute = 22;
* @param {boolean=} opt_noLazyCreate Do not create the map if
* empty, instead returning `undefined`
* @return {!jspb.Map<string,number>}
*/
proto.node.BtfsScanTab.prototype.getVersionDistributeMap = function(opt_noLazyCreate) {
return /** @type {!jspb.Map<string,number>} */ (
jspb.Message.getMapField(this, 22, opt_noLazyCreate,
null));
};


/**
* Clears values from the map. The map will be non-null.
* @return {!proto.node.BtfsScanTab} returns this
*/
proto.node.BtfsScanTab.prototype.clearVersionDistributeMap = function() {
this.getVersionDistributeMap().clear();
return this;};





Expand Down
Loading

0 comments on commit 4bce40f

Please sign in to comment.