Skip to content

Commit

Permalink
0.13.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dexturr committed Jan 30, 2024
1 parent 8f75522 commit a0dfb82
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "vega"]
path = vendor/vega
url = [email protected]:vegaprotocol/vega.git
branch = release/v0.74.0-preview.5
branch = release/v0.74.0-preview.7
68 changes: 34 additions & 34 deletions messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2885,6 +2885,34 @@
"oneofIndex": 0,
"oneofName": "command"
},
{
"name": "batchProposalSubmission",
"number": 1023,
"type": "message",
"wireType": "bytes",
"repeated": false,
"packed": false,
"optional": false,
"typeName": ".vega.commands.v1.BatchProposalSubmission",
"messageType": "BatchProposalSubmission",
"messageTypeLocal": null,
"oneofIndex": 0,
"oneofName": "command"
},
{
"name": "updatePartyProfile",
"number": 1024,
"type": "message",
"wireType": "bytes",
"repeated": false,
"packed": false,
"optional": false,
"typeName": ".vega.commands.v1.UpdatePartyProfile",
"messageType": "UpdatePartyProfile",
"messageTypeLocal": null,
"oneofIndex": 0,
"oneofName": "command"
},
{
"name": "nodeVote",
"number": 2002,
Expand Down Expand Up @@ -3024,34 +3052,6 @@
"messageTypeLocal": null,
"oneofIndex": 0,
"oneofName": "command"
},
{
"name": "batchProposalSubmission",
"number": 3002,
"type": "message",
"wireType": "bytes",
"repeated": false,
"packed": false,
"optional": false,
"typeName": ".vega.commands.v1.BatchProposalSubmission",
"messageType": "BatchProposalSubmission",
"messageTypeLocal": null,
"oneofIndex": 0,
"oneofName": "command"
},
{
"name": "updatePartyProfile",
"number": 3003,
"type": "message",
"wireType": "bytes",
"repeated": false,
"packed": false,
"optional": false,
"typeName": ".vega.commands.v1.UpdatePartyProfile",
"messageType": "UpdatePartyProfile",
"messageTypeLocal": null,
"oneofIndex": 0,
"oneofName": "command"
}
]
},
Expand Down Expand Up @@ -6703,7 +6703,7 @@
"oneofName": null
},
{
"name": "indexPriceConfig",
"name": "internalCompositePriceConfig",
"number": 13,
"type": "message",
"wireType": "bytes",
Expand Down Expand Up @@ -11432,7 +11432,7 @@
"oneofIndex": null
},
{
"name": "indexPrice",
"name": "internalCompositePrice",
"number": 7,
"type": "string",
"wireType": "bytes",
Expand All @@ -11444,7 +11444,7 @@
"oneofIndex": null
},
{
"name": "nextIndexPriceCalc",
"name": "nextInternalCompositePriceCalc",
"number": 8,
"type": "int64",
"wireType": "varint",
Expand All @@ -11456,7 +11456,7 @@
"oneofIndex": null
},
{
"name": "indexPriceType",
"name": "internalCompositePriceType",
"number": 9,
"type": "enumerable",
"wireType": "varint",
Expand Down Expand Up @@ -15191,7 +15191,7 @@
"oneofName": null
},
{
"name": "indexPriceConfiguration",
"name": "internalCompositePriceConfiguration",
"number": 13,
"type": "message",
"wireType": "bytes",
Expand Down Expand Up @@ -16349,7 +16349,7 @@
"oneofName": null
},
{
"name": "indexPriceConfiguration",
"name": "internalCompositePriceConfiguration",
"number": 13,
"type": "message",
"wireType": "bytes",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vegaprotocol/protos",
"version": "0.12.0",
"version": "0.13.0",
"description": "Protocol Buffer messages for Vega in Javascript",
"scripts": {
"test": "brittle tests/**/*.js"
Expand Down
3 changes: 2 additions & 1 deletion tests/proposal-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ test("encode then decode proposal submission", (assert) => {
fundingRateScalingFactor: null,
fundingRateLowerBound: null,
fundingRateUpperBound: null,
indexPriceConfiguration: null,
internalCompositePriceConfiguration: null,
},
},
},
Expand Down Expand Up @@ -328,6 +328,7 @@ test("encode then decode proposal submission", (assert) => {
};

const actual = InputData.decode(InputData.encode({ proposalSubmission }));

assert.alike(actual, expected);

assert.end();
Expand Down
2 changes: 1 addition & 1 deletion vega/Perpetual.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export type Perpetual = {
fundingRateScalingFactor: string | null
fundingRateLowerBound: string | null
fundingRateUpperBound: string | null
indexPriceConfig: CompositePriceConfiguration | null
internalCompositePriceConfig: CompositePriceConfiguration | null
}
7 changes: 4 additions & 3 deletions vega/Perpetual/decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports.decode = function decode(
let field$fundingRateScalingFactor = null
let field$fundingRateLowerBound = null
let field$fundingRateUpperBound = null
let field$indexPriceConfig = null
let field$internalCompositePriceConfig = null
for (const [field, { data }] of reader(buf, byteOffset, byteLength)) {
switch (field) {
case 1:
Expand Down Expand Up @@ -77,7 +77,8 @@ exports.decode = function decode(
break

case 13:
field$indexPriceConfig = _vega_CompositePriceConfiguration.decode(data)
field$internalCompositePriceConfig =
_vega_CompositePriceConfiguration.decode(data)
break
}
}
Expand All @@ -95,6 +96,6 @@ exports.decode = function decode(
fundingRateScalingFactor: field$fundingRateScalingFactor,
fundingRateLowerBound: field$fundingRateLowerBound,
fundingRateUpperBound: field$fundingRateUpperBound,
indexPriceConfig: field$indexPriceConfig
internalCompositePriceConfig: field$internalCompositePriceConfig
}
}
4 changes: 2 additions & 2 deletions vega/Perpetual/encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) {
writer.bytes(11, obj.fundingRateLowerBound, string)
if (obj.fundingRateUpperBound)
writer.bytes(12, obj.fundingRateUpperBound, string)
if (obj.indexPriceConfig)
if (obj.internalCompositePriceConfig)
writer.bytes(
13,
_vega_CompositePriceConfiguration.encode(obj.indexPriceConfig)
_vega_CompositePriceConfiguration.encode(obj.internalCompositePriceConfig)
)

return writer.concat(buf, byteOffset)
Expand Down
6 changes: 3 additions & 3 deletions vega/PerpetualData.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type PerpetualData = {
externalTwap: string
seqNum: bigint
startTime: bigint
indexPrice: string
nextIndexPriceCalc: bigint
indexPriceType: CompositePriceType
internalCompositePrice: string
nextInternalCompositePriceCalc: bigint
internalCompositePriceType: CompositePriceType
}
18 changes: 9 additions & 9 deletions vega/PerpetualData/decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ exports.decode = function decode(
let field$externalTwap = ''
let field$seqNum = 0n
let field$startTime = 0n
let field$indexPrice = ''
let field$nextIndexPriceCalc = 0n
let field$indexPriceType = _vega_CompositePriceType.decode(0)
let field$internalCompositePrice = ''
let field$nextInternalCompositePriceCalc = 0n
let field$internalCompositePriceType = _vega_CompositePriceType.decode(0)
for (const [field, { data }] of reader(buf, byteOffset, byteLength)) {
switch (field) {
case 1:
Expand Down Expand Up @@ -44,15 +44,15 @@ exports.decode = function decode(
break

case 7:
field$indexPrice = string(data)
field$internalCompositePrice = string(data)
break

case 8:
field$nextIndexPriceCalc = int64(data)
field$nextInternalCompositePriceCalc = int64(data)
break

case 9:
field$indexPriceType = _vega_CompositePriceType.decode(data)
field$internalCompositePriceType = _vega_CompositePriceType.decode(data)
break
}
}
Expand All @@ -63,8 +63,8 @@ exports.decode = function decode(
externalTwap: field$externalTwap,
seqNum: field$seqNum,
startTime: field$startTime,
indexPrice: field$indexPrice,
nextIndexPriceCalc: field$nextIndexPriceCalc,
indexPriceType: field$indexPriceType
internalCompositePrice: field$internalCompositePrice,
nextInternalCompositePriceCalc: field$nextInternalCompositePriceCalc,
internalCompositePriceType: field$internalCompositePriceType
}
}
10 changes: 6 additions & 4 deletions vega/PerpetualData/encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) {
if (obj.externalTwap) writer.bytes(4, obj.externalTwap, string)
if (obj.seqNum) writer.varint(5, obj.seqNum, uint64)
if (obj.startTime) writer.varint(6, obj.startTime, int64)
if (obj.indexPrice) writer.bytes(7, obj.indexPrice, string)
if (obj.nextIndexPriceCalc) writer.varint(8, obj.nextIndexPriceCalc, int64)
if (obj.indexPriceType)
writer.varint(9, obj.indexPriceType, _vega_CompositePriceType)
if (obj.internalCompositePrice)
writer.bytes(7, obj.internalCompositePrice, string)
if (obj.nextInternalCompositePriceCalc)
writer.varint(8, obj.nextInternalCompositePriceCalc, int64)
if (obj.internalCompositePriceType)
writer.varint(9, obj.internalCompositePriceType, _vega_CompositePriceType)

return writer.concat(buf, byteOffset)
}
Expand Down
2 changes: 1 addition & 1 deletion vega/PerpetualProduct.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export type PerpetualProduct = {
fundingRateScalingFactor: string | null
fundingRateLowerBound: string | null
fundingRateUpperBound: string | null
indexPriceConfiguration: CompositePriceConfiguration | null
internalCompositePriceConfiguration: CompositePriceConfiguration | null
}
7 changes: 4 additions & 3 deletions vega/PerpetualProduct/decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports.decode = function decode(
let field$fundingRateScalingFactor = null
let field$fundingRateLowerBound = null
let field$fundingRateUpperBound = null
let field$indexPriceConfiguration = null
let field$internalCompositePriceConfiguration = null
for (const [field, { data }] of reader(buf, byteOffset, byteLength)) {
switch (field) {
case 1:
Expand Down Expand Up @@ -77,7 +77,7 @@ exports.decode = function decode(
break

case 13:
field$indexPriceConfiguration =
field$internalCompositePriceConfiguration =
_vega_CompositePriceConfiguration.decode(data)
break
}
Expand All @@ -96,6 +96,7 @@ exports.decode = function decode(
fundingRateScalingFactor: field$fundingRateScalingFactor,
fundingRateLowerBound: field$fundingRateLowerBound,
fundingRateUpperBound: field$fundingRateUpperBound,
indexPriceConfiguration: field$indexPriceConfiguration
internalCompositePriceConfiguration:
field$internalCompositePriceConfiguration
}
}
6 changes: 4 additions & 2 deletions vega/PerpetualProduct/encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) {
writer.bytes(11, obj.fundingRateLowerBound, string)
if (obj.fundingRateUpperBound)
writer.bytes(12, obj.fundingRateUpperBound, string)
if (obj.indexPriceConfiguration)
if (obj.internalCompositePriceConfiguration)
writer.bytes(
13,
_vega_CompositePriceConfiguration.encode(obj.indexPriceConfiguration)
_vega_CompositePriceConfiguration.encode(
obj.internalCompositePriceConfiguration
)
)

return writer.concat(buf, byteOffset)
Expand Down
2 changes: 1 addition & 1 deletion vega/UpdatePerpetualProduct.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ export type UpdatePerpetualProduct = {
fundingRateScalingFactor: string | null
fundingRateLowerBound: string | null
fundingRateUpperBound: string | null
indexPriceConfiguration: CompositePriceConfiguration | null
internalCompositePriceConfiguration: CompositePriceConfiguration | null
}
7 changes: 4 additions & 3 deletions vega/UpdatePerpetualProduct/decode.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports.decode = function decode(
let field$fundingRateScalingFactor = null
let field$fundingRateLowerBound = null
let field$fundingRateUpperBound = null
let field$indexPriceConfiguration = null
let field$internalCompositePriceConfiguration = null
for (const [field, { data }] of reader(buf, byteOffset, byteLength)) {
switch (field) {
case 1:
Expand Down Expand Up @@ -72,7 +72,7 @@ exports.decode = function decode(
break

case 13:
field$indexPriceConfiguration =
field$internalCompositePriceConfiguration =
_vega_CompositePriceConfiguration.decode(data)
break
}
Expand All @@ -90,6 +90,7 @@ exports.decode = function decode(
fundingRateScalingFactor: field$fundingRateScalingFactor,
fundingRateLowerBound: field$fundingRateLowerBound,
fundingRateUpperBound: field$fundingRateUpperBound,
indexPriceConfiguration: field$indexPriceConfiguration
internalCompositePriceConfiguration:
field$internalCompositePriceConfiguration
}
}
6 changes: 4 additions & 2 deletions vega/UpdatePerpetualProduct/encode.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ exports.encode = function encode(obj = {}, buf, byteOffset = 0) {
writer.bytes(10, obj.fundingRateLowerBound, string)
if (obj.fundingRateUpperBound)
writer.bytes(11, obj.fundingRateUpperBound, string)
if (obj.indexPriceConfiguration)
if (obj.internalCompositePriceConfiguration)
writer.bytes(
13,
_vega_CompositePriceConfiguration.encode(obj.indexPriceConfiguration)
_vega_CompositePriceConfiguration.encode(
obj.internalCompositePriceConfiguration
)
)

return writer.concat(buf, byteOffset)
Expand Down
Loading

0 comments on commit a0dfb82

Please sign in to comment.