Skip to content

Commit

Permalink
added params for sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
omerlavanet committed Mar 23, 2022
1 parent f4aa15d commit b35cc99
Show file tree
Hide file tree
Showing 17 changed files with 457 additions and 66 deletions.
27 changes: 27 additions & 0 deletions docs/static/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12720,6 +12720,15 @@ paths:
servicersToPairCount:
type: string
format: uint64
sessionBlocks:
type: string
format: uint64
sessionsToSave:
type: string
format: uint64
sessionBlocksOverlap:
type: string
format: uint64
description: >-
QueryParamsResponse is response type for the Query/Params RPC
method.
Expand Down Expand Up @@ -21845,6 +21854,15 @@ definitions:
servicersToPairCount:
type: string
format: uint64
sessionBlocks:
type: string
format: uint64
sessionsToSave:
type: string
format: uint64
sessionBlocksOverlap:
type: string
format: uint64
description: Params defines the parameters for the module.
lavanet.lava.servicer.QueryAllSpecStakeStorageResponse:
type: object
Expand Down Expand Up @@ -22315,6 +22333,15 @@ definitions:
servicersToPairCount:
type: string
format: uint64
sessionBlocks:
type: string
format: uint64
sessionsToSave:
type: string
format: uint64
sessionBlocksOverlap:
type: string
format: uint64
description: QueryParamsResponse is response type for the Query/Params RPC method.
lavanet.lava.servicer.QueryStakedServicersResponse:
type: object
Expand Down
3 changes: 3 additions & 0 deletions proto/servicer/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ message Params {
uint64 fraudStakeSlashingFactor = 4 [(gogoproto.moretags) = "yaml:\"fraud_stake_slashing_factor\""];
uint64 fraudSlashingAmount = 5 [(gogoproto.moretags) = "yaml:\"fraud_slashing_amount\""];
uint64 servicersToPairCount = 6 [(gogoproto.moretags) = "yaml:\"servicers_to_pair_count\""];
uint64 sessionBlocks = 7 [(gogoproto.moretags) = "yaml:\"session_blocks\""];
uint64 sessionsToSave = 8 [(gogoproto.moretags) = "yaml:\"sessions_to_save\""];
uint64 sessionBlocksOverlap = 9 [(gogoproto.moretags) = "yaml:\"session_block_overlap\""];
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ export interface ServicerParams {
fraudSlashingAmount?: string;
/** @format uint64 */
servicersToPairCount?: string;
/** @format uint64 */
sessionBlocks?: string;
/** @format uint64 */
sessionsToSave?: string;
/** @format uint64 */
sessionBlocksOverlap?: string;
}
export interface ServicerQueryAllSpecStakeStorageResponse {
specStakeStorage?: ServicerSpecStakeStorage[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ export interface ServicerParams {

/** @format uint64 */
servicersToPairCount?: string;

/** @format uint64 */
sessionBlocks?: string;

/** @format uint64 */
sessionsToSave?: string;

/** @format uint64 */
sessionBlocksOverlap?: string;
}

export interface ServicerQueryAllSpecStakeStorageResponse {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export interface Params {
fraudStakeSlashingFactor: number;
fraudSlashingAmount: number;
servicersToPairCount: number;
sessionBlocks: number;
sessionsToSave: number;
sessionBlocksOverlap: number;
}
export declare const Params: {
encode(message: Params, writer?: Writer): Writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const baseParams = {
fraudStakeSlashingFactor: 0,
fraudSlashingAmount: 0,
servicersToPairCount: 0,
sessionBlocks: 0,
sessionsToSave: 0,
sessionBlocksOverlap: 0,
};
export const Params = {
encode(message, writer = Writer.create()) {
Expand All @@ -30,6 +33,15 @@ export const Params = {
if (message.servicersToPairCount !== 0) {
writer.uint32(48).uint64(message.servicersToPairCount);
}
if (message.sessionBlocks !== 0) {
writer.uint32(56).uint64(message.sessionBlocks);
}
if (message.sessionsToSave !== 0) {
writer.uint32(64).uint64(message.sessionsToSave);
}
if (message.sessionBlocksOverlap !== 0) {
writer.uint32(72).uint64(message.sessionBlocksOverlap);
}
return writer;
},
decode(input, length) {
Expand Down Expand Up @@ -57,6 +69,15 @@ export const Params = {
case 6:
message.servicersToPairCount = longToNumber(reader.uint64());
break;
case 7:
message.sessionBlocks = longToNumber(reader.uint64());
break;
case 8:
message.sessionsToSave = longToNumber(reader.uint64());
break;
case 9:
message.sessionBlocksOverlap = longToNumber(reader.uint64());
break;
default:
reader.skipType(tag & 7);
break;
Expand Down Expand Up @@ -106,6 +127,25 @@ export const Params = {
else {
message.servicersToPairCount = 0;
}
if (object.sessionBlocks !== undefined && object.sessionBlocks !== null) {
message.sessionBlocks = Number(object.sessionBlocks);
}
else {
message.sessionBlocks = 0;
}
if (object.sessionsToSave !== undefined && object.sessionsToSave !== null) {
message.sessionsToSave = Number(object.sessionsToSave);
}
else {
message.sessionsToSave = 0;
}
if (object.sessionBlocksOverlap !== undefined &&
object.sessionBlocksOverlap !== null) {
message.sessionBlocksOverlap = Number(object.sessionBlocksOverlap);
}
else {
message.sessionBlocksOverlap = 0;
}
return message;
},
toJSON(message) {
Expand All @@ -120,6 +160,12 @@ export const Params = {
(obj.fraudSlashingAmount = message.fraudSlashingAmount);
message.servicersToPairCount !== undefined &&
(obj.servicersToPairCount = message.servicersToPairCount);
message.sessionBlocks !== undefined &&
(obj.sessionBlocks = message.sessionBlocks);
message.sessionsToSave !== undefined &&
(obj.sessionsToSave = message.sessionsToSave);
message.sessionBlocksOverlap !== undefined &&
(obj.sessionBlocksOverlap = message.sessionBlocksOverlap);
return obj;
},
fromPartial(object) {
Expand Down Expand Up @@ -164,6 +210,25 @@ export const Params = {
else {
message.servicersToPairCount = 0;
}
if (object.sessionBlocks !== undefined && object.sessionBlocks !== null) {
message.sessionBlocks = object.sessionBlocks;
}
else {
message.sessionBlocks = 0;
}
if (object.sessionsToSave !== undefined && object.sessionsToSave !== null) {
message.sessionsToSave = object.sessionsToSave;
}
else {
message.sessionsToSave = 0;
}
if (object.sessionBlocksOverlap !== undefined &&
object.sessionBlocksOverlap !== null) {
message.sessionBlocksOverlap = object.sessionBlocksOverlap;
}
else {
message.sessionBlocksOverlap = 0;
}
return message;
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export interface Params {
fraudStakeSlashingFactor: number;
fraudSlashingAmount: number;
servicersToPairCount: number;
sessionBlocks: number;
sessionsToSave: number;
sessionBlocksOverlap: number;
}

const baseParams: object = {
Expand All @@ -21,6 +24,9 @@ const baseParams: object = {
fraudStakeSlashingFactor: 0,
fraudSlashingAmount: 0,
servicersToPairCount: 0,
sessionBlocks: 0,
sessionsToSave: 0,
sessionBlocksOverlap: 0,
};

export const Params = {
Expand All @@ -43,6 +49,15 @@ export const Params = {
if (message.servicersToPairCount !== 0) {
writer.uint32(48).uint64(message.servicersToPairCount);
}
if (message.sessionBlocks !== 0) {
writer.uint32(56).uint64(message.sessionBlocks);
}
if (message.sessionsToSave !== 0) {
writer.uint32(64).uint64(message.sessionsToSave);
}
if (message.sessionBlocksOverlap !== 0) {
writer.uint32(72).uint64(message.sessionBlocksOverlap);
}
return writer;
},

Expand Down Expand Up @@ -73,6 +88,15 @@ export const Params = {
case 6:
message.servicersToPairCount = longToNumber(reader.uint64() as Long);
break;
case 7:
message.sessionBlocks = longToNumber(reader.uint64() as Long);
break;
case 8:
message.sessionsToSave = longToNumber(reader.uint64() as Long);
break;
case 9:
message.sessionBlocksOverlap = longToNumber(reader.uint64() as Long);
break;
default:
reader.skipType(tag & 7);
break;
Expand Down Expand Up @@ -127,6 +151,24 @@ export const Params = {
} else {
message.servicersToPairCount = 0;
}
if (object.sessionBlocks !== undefined && object.sessionBlocks !== null) {
message.sessionBlocks = Number(object.sessionBlocks);
} else {
message.sessionBlocks = 0;
}
if (object.sessionsToSave !== undefined && object.sessionsToSave !== null) {
message.sessionsToSave = Number(object.sessionsToSave);
} else {
message.sessionsToSave = 0;
}
if (
object.sessionBlocksOverlap !== undefined &&
object.sessionBlocksOverlap !== null
) {
message.sessionBlocksOverlap = Number(object.sessionBlocksOverlap);
} else {
message.sessionBlocksOverlap = 0;
}
return message;
},

Expand All @@ -142,6 +184,12 @@ export const Params = {
(obj.fraudSlashingAmount = message.fraudSlashingAmount);
message.servicersToPairCount !== undefined &&
(obj.servicersToPairCount = message.servicersToPairCount);
message.sessionBlocks !== undefined &&
(obj.sessionBlocks = message.sessionBlocks);
message.sessionsToSave !== undefined &&
(obj.sessionsToSave = message.sessionsToSave);
message.sessionBlocksOverlap !== undefined &&
(obj.sessionBlocksOverlap = message.sessionBlocksOverlap);
return obj;
},

Expand Down Expand Up @@ -189,6 +237,24 @@ export const Params = {
} else {
message.servicersToPairCount = 0;
}
if (object.sessionBlocks !== undefined && object.sessionBlocks !== null) {
message.sessionBlocks = object.sessionBlocks;
} else {
message.sessionBlocks = 0;
}
if (object.sessionsToSave !== undefined && object.sessionsToSave !== null) {
message.sessionsToSave = object.sessionsToSave;
} else {
message.sessionsToSave = 0;
}
if (
object.sessionBlocksOverlap !== undefined &&
object.sessionBlocksOverlap !== null
) {
message.sessionBlocksOverlap = object.sessionBlocksOverlap;
} else {
message.sessionBlocksOverlap = 0;
}
return message;
},
};
Expand Down
Loading

0 comments on commit b35cc99

Please sign in to comment.