Skip to content

Commit

Permalink
Update generated XDR to latest version. (#587)
Browse files Browse the repository at this point in the history
* Add the hacky namespace workarounds we use
  • Loading branch information
Shaptic authored Apr 20, 2023
1 parent 777e85c commit 6cefb3e
Show file tree
Hide file tree
Showing 13 changed files with 26,296 additions and 22,413 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test:browser": "karma start ./config/karma.conf.js",
"docs": "jsdoc -c ./config/.jsdoc.json --verbose",
"lint": "eslint -c ./config/.eslintrc.js src/ && dtslint --localTs node_modules/typescript/lib types/",
"preversion": "yarn clean && yarn pretty && yarn lint && yarn build:prod && yarn test",
"preversion": "yarn clean && yarn fmt && yarn lint && yarn build:prod && yarn test",
"fmt": "prettier --config ./config/prettier.config.js --ignore-path ./config/.prettierignore --write './**/*.js'",
"prepare": "yarn build:prod",
"clean": "rm -rf lib/ dist/ coverage/ .nyc_output/"
Expand Down
81 changes: 76 additions & 5 deletions src/generated/curr_generated.js
Original file line number Diff line number Diff line change
Expand Up @@ -2847,18 +2847,23 @@ xdr.struct("Hello", [
["nonce", xdr.lookup("Uint256")],
]);

// === xdr source ============================================================
//
// const AUTH_MSG_FLAG_PULL_MODE_REQUESTED = 100;
//
// ===========================================================================
xdr.const("AUTH_MSG_FLAG_PULL_MODE_REQUESTED", 100);

// === xdr source ============================================================
//
// struct Auth
// {
// // Empty message, just to confirm
// // establishment of MAC keys.
// int unused;
// int flags;
// };
//
// ===========================================================================
xdr.struct("Auth", [
["unused", xdr.int()],
["flags", xdr.int()],
]);

// === xdr source ============================================================
Expand Down Expand Up @@ -2951,7 +2956,9 @@ xdr.struct("PeerAddress", [
// SURVEY_REQUEST = 14,
// SURVEY_RESPONSE = 15,
//
// SEND_MORE = 16
// SEND_MORE = 16,
// FLOOD_ADVERT = 18,
// FLOOD_DEMAND = 19
// };
//
// ===========================================================================
Expand All @@ -2973,6 +2980,8 @@ xdr.enum("MessageType", {
surveyRequest: 14,
surveyResponse: 15,
sendMore: 16,
floodAdvert: 18,
floodDemand: 19,
});

// === xdr source ============================================================
Expand Down Expand Up @@ -3164,6 +3173,58 @@ xdr.union("SurveyResponseBody", {
},
});

// === xdr source ============================================================
//
// const TX_ADVERT_VECTOR_MAX_SIZE = 1000;
//
// ===========================================================================
xdr.const("TX_ADVERT_VECTOR_MAX_SIZE", 1000);

// === xdr source ============================================================
//
// typedef Hash TxAdvertVector<TX_ADVERT_VECTOR_MAX_SIZE>;
//
// ===========================================================================
xdr.typedef("TxAdvertVector", xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_ADVERT_VECTOR_MAX_SIZE")));

// === xdr source ============================================================
//
// struct FloodAdvert
// {
// TxAdvertVector txHashes;
// };
//
// ===========================================================================
xdr.struct("FloodAdvert", [
["txHashes", xdr.lookup("TxAdvertVector")],
]);

// === xdr source ============================================================
//
// const TX_DEMAND_VECTOR_MAX_SIZE = 1000;
//
// ===========================================================================
xdr.const("TX_DEMAND_VECTOR_MAX_SIZE", 1000);

// === xdr source ============================================================
//
// typedef Hash TxDemandVector<TX_DEMAND_VECTOR_MAX_SIZE>;
//
// ===========================================================================
xdr.typedef("TxDemandVector", xdr.varArray(xdr.lookup("Hash"), xdr.lookup("TX_DEMAND_VECTOR_MAX_SIZE")));

// === xdr source ============================================================
//
// struct FloodDemand
// {
// TxDemandVector txHashes;
// };
//
// ===========================================================================
xdr.struct("FloodDemand", [
["txHashes", xdr.lookup("TxDemandVector")],
]);

// === xdr source ============================================================
//
// union StellarMessage switch (MessageType type)
Expand Down Expand Up @@ -3208,6 +3269,12 @@ xdr.union("SurveyResponseBody", {
// uint32 getSCPLedgerSeq; // ledger seq requested ; if 0, requests the latest
// case SEND_MORE:
// SendMore sendMoreMessage;
//
// // Pull mode
// case FLOOD_ADVERT:
// FloodAdvert floodAdvert;
// case FLOOD_DEMAND:
// FloodDemand floodDemand;
// };
//
// ===========================================================================
Expand All @@ -3232,6 +3299,8 @@ xdr.union("StellarMessage", {
["scpMessage", "envelope"],
["getScpState", "getScpLedgerSeq"],
["sendMore", "sendMoreMessage"],
["floodAdvert", "floodAdvert"],
["floodDemand", "floodDemand"],
],
arms: {
error: xdr.lookup("Error"),
Expand All @@ -3250,6 +3319,8 @@ xdr.union("StellarMessage", {
envelope: xdr.lookup("ScpEnvelope"),
getScpLedgerSeq: xdr.lookup("Uint32"),
sendMoreMessage: xdr.lookup("SendMore"),
floodAdvert: xdr.lookup("FloodAdvert"),
floodDemand: xdr.lookup("FloodDemand"),
},
});

Expand Down
Loading

0 comments on commit 6cefb3e

Please sign in to comment.