From 77ad2afa7ce6fedc93b9a9bc2c363ebeb2631bd5 Mon Sep 17 00:00:00 2001 From: Andrew Rogers Date: Wed, 29 Apr 2015 12:02:25 -0700 Subject: [PATCH] Update xdr --- Gemfile | 3 +- Gemfile.lock | 1 + src/generated/stellar-xdr_generated.js | 185 +++++++++++++------------ xdr/Stellar-transaction.x | 92 ++++++------ 4 files changed, 145 insertions(+), 136 deletions(-) diff --git a/Gemfile b/Gemfile index 2ea7e3d3d..61d629392 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,6 @@ +source "https://rubygems.org" gem 'xdrgen', git: 'git@github.com:stellar/xdrgen.git' # gem "xdrgen", path: "../xdrgen" gem 'pry' gem 'octokit' -gem 'netrc' \ No newline at end of file +gem 'netrc' diff --git a/Gemfile.lock b/Gemfile.lock index 261c50c53..76fc16c4b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,6 +9,7 @@ GIT treetop (~> 1.5.3) GEM + remote: https://rubygems.org/ specs: activesupport (4.2.1) i18n (~> 0.7) diff --git a/src/generated/stellar-xdr_generated.js b/src/generated/stellar-xdr_generated.js index 8881ec948..1e3782104 100644 --- a/src/generated/stellar-xdr_generated.js +++ b/src/generated/stellar-xdr_generated.js @@ -1,4 +1,4 @@ -// Automatically generated on 2015-04-07T07:50:08-07:00 +// Automatically generated on 2015-04-29T12:01:45-07:00 // DO NOT EDIT or your changes may be overwritten /* jshint maxstatements:2147483647 */ @@ -1131,28 +1131,30 @@ xdr.struct("ClaimOfferAtom", [ // PAYMENT_SUCCESS_MULTI = 1, // multi-path payment success // // // codes considered as "failure" for the operation -// PAYMENT_UNDERFUNDED = 2, // not enough funds in source account -// PAYMENT_NO_DESTINATION = 3, // destination account does not exist -// PAYMENT_NO_TRUST = 4, // destination missing a trust line for currency -// PAYMENT_NOT_AUTHORIZED = 5, // destination not authorized to hold currency -// PAYMENT_LINE_FULL = 6, // destination would go above their limit -// PAYMENT_TOO_FEW_OFFERS = 7, // not enough offers to satisfy path payment -// PAYMENT_OVER_SENDMAX = 8, // multi-path payment could not satisfy sendmax -// PAYMENT_LOW_RESERVE = 9 // would create an account below the min reserve +// PAYMENT_MALFORMED = -1, // bad input +// PAYMENT_UNDERFUNDED = -2, // not enough funds in source account +// PAYMENT_NO_DESTINATION = -3, // destination account does not exist +// PAYMENT_NO_TRUST = -4, // destination missing a trust line for currency +// PAYMENT_NOT_AUTHORIZED = -5, // destination not authorized to hold currency +// PAYMENT_LINE_FULL = -6, // destination would go above their limit +// PAYMENT_TOO_FEW_OFFERS = -7, // not enough offers to satisfy path payment +// PAYMENT_OVER_SENDMAX = -8, // multi-path payment could not satisfy sendmax +// PAYMENT_LOW_RESERVE = -9 // would create an account below the min reserve // }; // // =========================================================================== xdr.enum("PaymentResultCode", { paymentSuccess: 0, paymentSuccessMulti: 1, - paymentUnderfunded: 2, - paymentNoDestination: 3, - paymentNoTrust: 4, - paymentNotAuthorized: 5, - paymentLineFull: 6, - paymentTooFewOffer: 7, - paymentOverSendmax: 8, - paymentLowReserve: 9, + paymentMalformed: -1, + paymentUnderfunded: -2, + paymentNoDestination: -3, + paymentNoTrust: -4, + paymentNotAuthorized: -5, + paymentLineFull: -6, + paymentTooFewOffer: -7, + paymentOverSendmax: -8, + paymentLowReserve: -9, }); // === xdr source ============================================================ @@ -1219,33 +1221,32 @@ xdr.union("PaymentResult", { // CREATE_OFFER_SUCCESS = 0, // // // codes considered as "failure" for the operation -// CREATE_OFFER_NO_TRUST = 1, // can't hold what it's buying -// CREATE_OFFER_NOT_AUTHORIZED = 2, // not authorized to hold what it's buying -// CREATE_OFFER_LINE_FULL = 3, // can't receive more of what it's buying -// CREATE_OFFER_MALFORMED = 4, // generated offer would be invalid -// CREATE_OFFER_UNDERFUNDED = 5, // doesn't hold what it's trying to sell -// CREATE_OFFER_CROSS_SELF = 6, // would cross an offer from the same user +// CREATE_OFFER_MALFORMED = -1, // generated offer would be invalid +// CREATE_OFFER_NO_TRUST = -2, // can't hold what it's buying +// CREATE_OFFER_NOT_AUTHORIZED = -3, // not authorized to hold what it's buying +// CREATE_OFFER_LINE_FULL = -4, // can't receive more of what it's buying +// CREATE_OFFER_UNDERFUNDED = -5, // doesn't hold what it's trying to sell +// CREATE_OFFER_CROSS_SELF = -6, // would cross an offer from the same user // // // update errors -// CREATE_OFFER_NOT_FOUND = 7, // offerID does not match an existing offer -// CREATE_OFFER_MISMATCH = 8, // currencies don't match offer -// -// CREATE_OFFER_LOW_RESERVE = 9 // not enough funds to create a new Offer +// CREATE_OFFER_NOT_FOUND = -7, // offerID does not match an existing offer +// CREATE_OFFER_MISMATCH = -8, // currencies don't match offer // +// CREATE_OFFER_LOW_RESERVE = -9 // not enough funds to create a new Offer // }; // // =========================================================================== xdr.enum("CreateOfferResultCode", { createOfferSuccess: 0, - createOfferNoTrust: 1, - createOfferNotAuthorized: 2, - createOfferLineFull: 3, - createOfferMalformed: 4, - createOfferUnderfunded: 5, - createOfferCrossSelf: 6, - createOfferNotFound: 7, - createOfferMismatch: 8, - createOfferLowReserve: 9, + createOfferMalformed: -1, + createOfferNoTrust: -2, + createOfferNotAuthorized: -3, + createOfferLineFull: -4, + createOfferUnderfunded: -5, + createOfferCrossSelf: -6, + createOfferNotFound: -7, + createOfferMismatch: -8, + createOfferLowReserve: -9, }); // === xdr source ============================================================ @@ -1343,17 +1344,19 @@ xdr.union("CreateOfferResult", { // // codes considered as "success" for the operation // SET_OPTIONS_SUCCESS = 0, // // codes considered as "failure" for the operation -// SET_OPTIONS_LOW_RESERVE = 1, // not enough funds to add a signer -// SET_OPTIONS_TOO_MANY_SIGNERS = 2, // max number of signers already reached -// SET_OPTIONS_BAD_FLAGS = 3 // invalid combination of clear/set flags +// SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer +// SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached +// SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags +// SET_OPTIONS_INVALID_INFLATION = -4 // inflation account does not exist // }; // // =========================================================================== xdr.enum("SetOptionsResultCode", { setOptionsSuccess: 0, - setOptionsLowReserve: 1, - setOptionsTooManySigner: 2, - setOptionsBadFlag: 3, + setOptionsLowReserve: -1, + setOptionsTooManySigner: -2, + setOptionsBadFlag: -3, + setOptionsInvalidInflation: -4, }); // === xdr source ============================================================ @@ -1385,17 +1388,19 @@ xdr.union("SetOptionsResult", { // // codes considered as "success" for the operation // CHANGE_TRUST_SUCCESS = 0, // // codes considered as "failure" for the operation -// CHANGE_TRUST_NO_ISSUER = 1, // could not find issuer -// CHANGE_TRUST_INVALID_LIMIT = 2, // cannot drop limit below balance -// CHANGE_TRUST_LOW_RESERVE = 3 // not enough funds to create a new trust line +// CHANGE_TRUST_MALFORMED = -1, // bad input +// CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer +// CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance +// CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line // }; // // =========================================================================== xdr.enum("ChangeTrustResultCode", { changeTrustSuccess: 0, - changeTrustNoIssuer: 1, - changeTrustInvalidLimit: 2, - changeTrustLowReserve: 3, + changeTrustMalformed: -1, + changeTrustNoIssuer: -2, + changeTrustInvalidLimit: -3, + changeTrustLowReserve: -4, }); // === xdr source ============================================================ @@ -1427,17 +1432,17 @@ xdr.union("ChangeTrustResult", { // // codes considered as "success" for the operation // ALLOW_TRUST_SUCCESS = 0, // // codes considered as "failure" for the operation -// ALLOW_TRUST_MALFORMED = 1, // currency is not ISO4217 -// ALLOW_TRUST_NO_TRUST_LINE = 2, // trustor does not have a trustline -// ALLOW_TRUST_TRUST_NOT_REQUIRED = 3 // source account does not require trust +// ALLOW_TRUST_MALFORMED = -1, // currency is not ISO4217 +// ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline +// ALLOW_TRUST_TRUST_NOT_REQUIRED = -3 // source account does not require trust // }; // // =========================================================================== xdr.enum("AllowTrustResultCode", { allowTrustSuccess: 0, - allowTrustMalformed: 1, - allowTrustNoTrustLine: 2, - allowTrustTrustNotRequired: 3, + allowTrustMalformed: -1, + allowTrustNoTrustLine: -2, + allowTrustTrustNotRequired: -3, }); // === xdr source ============================================================ @@ -1469,19 +1474,19 @@ xdr.union("AllowTrustResult", { // // codes considered as "success" for the operation // ACCOUNT_MERGE_SUCCESS = 0, // // codes considered as "failure" for the operation -// ACCOUNT_MERGE_MALFORMED = 1, // can't merge onto itself -// ACCOUNT_MERGE_NO_ACCOUNT = 2, // destination does not exist -// ACCOUNT_MERGE_HAS_CREDIT = 3, // account has active trust lines -// ACCOUNT_MERGE_CREDIT_HELD = 4 // an issuer cannot be merged if used +// ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself +// ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist +// ACCOUNT_MERGE_HAS_CREDIT = -3, // account has active trust lines +// ACCOUNT_MERGE_CREDIT_HELD = -4 // an issuer cannot be merged if used // }; // // =========================================================================== xdr.enum("AccountMergeResultCode", { accountMergeSuccess: 0, - accountMergeMalformed: 1, - accountMergeNoAccount: 2, - accountMergeHasCredit: 3, - accountMergeCreditHeld: 4, + accountMergeMalformed: -1, + accountMergeNoAccount: -2, + accountMergeHasCredit: -3, + accountMergeCreditHeld: -4, }); // === xdr source ============================================================ @@ -1513,13 +1518,13 @@ xdr.union("AccountMergeResult", { // // codes considered as "success" for the operation // INFLATION_SUCCESS = 0, // // codes considered as "failure" for the operation -// INFLATION_NOT_TIME = 1 +// INFLATION_NOT_TIME = -1 // }; // // =========================================================================== xdr.enum("InflationResultCode", { inflationSuccess: 0, - inflationNotTime: 1, + inflationNotTime: -1, }); // === xdr source ============================================================ @@ -1565,15 +1570,15 @@ xdr.union("InflationResult", { // { // opINNER = 0, // inner object result is valid // -// opBAD_AUTH = 1, // not enough signatures to perform operation -// opNO_ACCOUNT = 2 // source account was not found +// opBAD_AUTH = -1, // not enough signatures to perform operation +// opNO_ACCOUNT = -2 // source account was not found // }; // // =========================================================================== xdr.enum("OperationResultCode", { opInner: 0, - opBadAuth: 1, - opNoAccount: 2, + opBadAuth: -1, + opNoAccount: -2, }); // === xdr source ============================================================ @@ -1666,36 +1671,36 @@ xdr.union("OperationResult", { // { // txSUCCESS = 0, // all operations succeeded // -// txDUPLICATE = 1, // transaction was already submited +// txDUPLICATE = -1, // transaction was already submited // -// txFAILED = 2, // one of the operations failed (but none were applied) +// txFAILED = -2, // one of the operations failed (but none were applied) // -// txBAD_LEDGER = 3, // ledger is not in range [minLeder; maxLedger] -// txMISSING_OPERATION = 4, // no operation was specified -// txBAD_SEQ = 5, // sequence number does not match source account +// txBAD_LEDGER = -3, // ledger is not in range [minLeder; maxLedger] +// txMISSING_OPERATION = -4, // no operation was specified +// txBAD_SEQ = -5, // sequence number does not match source account // -// txBAD_AUTH = 6, // not enough signatures to perform transaction -// txINSUFFICIENT_BALANCE = 7, // fee would bring account below reserve -// txNO_ACCOUNT = 8, // source account not found -// txINSUFFICIENT_FEE = 9, // max fee is too small -// txBAD_AUTH_EXTRA = 10, // too many signatures on transaction -// txINTERNAL_ERROR = 0xFFFFFFFF // an unknown error occured +// txBAD_AUTH = -6, // not enough signatures to perform transaction +// txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve +// txNO_ACCOUNT = -8, // source account not found +// txINSUFFICIENT_FEE = -9, // max fee is too small +// txBAD_AUTH_EXTRA = -10, // too many signatures on transaction +// txINTERNAL_ERROR = -11 // an unknown error occured // }; // // =========================================================================== xdr.enum("TransactionResultCode", { txSuccess: 0, - txDuplicate: 1, - txFailed: 2, - txBadLedger: 3, - txMissingOperation: 4, - txBadSeq: 5, - txBadAuth: 6, - txInsufficientBalance: 7, - txNoAccount: 8, - txInsufficientFee: 9, - txBadAuthExtra: 10, - txInternalError: -1, + txDuplicate: -1, + txFailed: -2, + txBadLedger: -3, + txMissingOperation: -4, + txBadSeq: -5, + txBadAuth: -6, + txInsufficientBalance: -7, + txNoAccount: -8, + txInsufficientFee: -9, + txBadAuthExtra: -10, + txInternalError: -11, }); // === xdr source ============================================================ diff --git a/xdr/Stellar-transaction.x b/xdr/Stellar-transaction.x index 94b921cab..018a09baf 100644 --- a/xdr/Stellar-transaction.x +++ b/xdr/Stellar-transaction.x @@ -233,14 +233,15 @@ enum PaymentResultCode PAYMENT_SUCCESS_MULTI = 1, // multi-path payment success // codes considered as "failure" for the operation - PAYMENT_UNDERFUNDED = 2, // not enough funds in source account - PAYMENT_NO_DESTINATION = 3, // destination account does not exist - PAYMENT_NO_TRUST = 4, // destination missing a trust line for currency - PAYMENT_NOT_AUTHORIZED = 5, // destination not authorized to hold currency - PAYMENT_LINE_FULL = 6, // destination would go above their limit - PAYMENT_TOO_FEW_OFFERS = 7, // not enough offers to satisfy path payment - PAYMENT_OVER_SENDMAX = 8, // multi-path payment could not satisfy sendmax - PAYMENT_LOW_RESERVE = 9 // would create an account below the min reserve + PAYMENT_MALFORMED = -1, // bad input + PAYMENT_UNDERFUNDED = -2, // not enough funds in source account + PAYMENT_NO_DESTINATION = -3, // destination account does not exist + PAYMENT_NO_TRUST = -4, // destination missing a trust line for currency + PAYMENT_NOT_AUTHORIZED = -5, // destination not authorized to hold currency + PAYMENT_LINE_FULL = -6, // destination would go above their limit + PAYMENT_TOO_FEW_OFFERS = -7, // not enough offers to satisfy path payment + PAYMENT_OVER_SENDMAX = -8, // multi-path payment could not satisfy sendmax + PAYMENT_LOW_RESERVE = -9 // would create an account below the min reserve }; struct SimplePaymentResult @@ -274,19 +275,18 @@ enum CreateOfferResultCode CREATE_OFFER_SUCCESS = 0, // codes considered as "failure" for the operation - CREATE_OFFER_NO_TRUST = 1, // can't hold what it's buying - CREATE_OFFER_NOT_AUTHORIZED = 2, // not authorized to hold what it's buying - CREATE_OFFER_LINE_FULL = 3, // can't receive more of what it's buying - CREATE_OFFER_MALFORMED = 4, // generated offer would be invalid - CREATE_OFFER_UNDERFUNDED = 5, // doesn't hold what it's trying to sell - CREATE_OFFER_CROSS_SELF = 6, // would cross an offer from the same user + CREATE_OFFER_MALFORMED = -1, // generated offer would be invalid + CREATE_OFFER_NO_TRUST = -2, // can't hold what it's buying + CREATE_OFFER_NOT_AUTHORIZED = -3, // not authorized to hold what it's buying + CREATE_OFFER_LINE_FULL = -4, // can't receive more of what it's buying + CREATE_OFFER_UNDERFUNDED = -5, // doesn't hold what it's trying to sell + CREATE_OFFER_CROSS_SELF = -6, // would cross an offer from the same user // update errors - CREATE_OFFER_NOT_FOUND = 7, // offerID does not match an existing offer - CREATE_OFFER_MISMATCH = 8, // currencies don't match offer - - CREATE_OFFER_LOW_RESERVE = 9 // not enough funds to create a new Offer + CREATE_OFFER_NOT_FOUND = -7, // offerID does not match an existing offer + CREATE_OFFER_MISMATCH = -8, // currencies don't match offer + CREATE_OFFER_LOW_RESERVE = -9 // not enough funds to create a new Offer }; enum CreateOfferEffect @@ -327,9 +327,10 @@ enum SetOptionsResultCode // codes considered as "success" for the operation SET_OPTIONS_SUCCESS = 0, // codes considered as "failure" for the operation - SET_OPTIONS_LOW_RESERVE = 1, // not enough funds to add a signer - SET_OPTIONS_TOO_MANY_SIGNERS = 2, // max number of signers already reached - SET_OPTIONS_BAD_FLAGS = 3 // invalid combination of clear/set flags + SET_OPTIONS_LOW_RESERVE = -1, // not enough funds to add a signer + SET_OPTIONS_TOO_MANY_SIGNERS = -2, // max number of signers already reached + SET_OPTIONS_BAD_FLAGS = -3, // invalid combination of clear/set flags + SET_OPTIONS_INVALID_INFLATION = -4 // inflation account does not exist }; union SetOptionsResult switch (SetOptionsResultCode code) @@ -347,9 +348,10 @@ enum ChangeTrustResultCode // codes considered as "success" for the operation CHANGE_TRUST_SUCCESS = 0, // codes considered as "failure" for the operation - CHANGE_TRUST_NO_ISSUER = 1, // could not find issuer - CHANGE_TRUST_INVALID_LIMIT = 2, // cannot drop limit below balance - CHANGE_TRUST_LOW_RESERVE = 3 // not enough funds to create a new trust line + CHANGE_TRUST_MALFORMED = -1, // bad input + CHANGE_TRUST_NO_ISSUER = -2, // could not find issuer + CHANGE_TRUST_INVALID_LIMIT = -3, // cannot drop limit below balance + CHANGE_TRUST_LOW_RESERVE = -4 // not enough funds to create a new trust line }; union ChangeTrustResult switch (ChangeTrustResultCode code) @@ -367,9 +369,9 @@ enum AllowTrustResultCode // codes considered as "success" for the operation ALLOW_TRUST_SUCCESS = 0, // codes considered as "failure" for the operation - ALLOW_TRUST_MALFORMED = 1, // currency is not ISO4217 - ALLOW_TRUST_NO_TRUST_LINE = 2, // trustor does not have a trustline - ALLOW_TRUST_TRUST_NOT_REQUIRED = 3 // source account does not require trust + ALLOW_TRUST_MALFORMED = -1, // currency is not ISO4217 + ALLOW_TRUST_NO_TRUST_LINE = -2, // trustor does not have a trustline + ALLOW_TRUST_TRUST_NOT_REQUIRED = -3 // source account does not require trust }; union AllowTrustResult switch (AllowTrustResultCode code) @@ -387,10 +389,10 @@ enum AccountMergeResultCode // codes considered as "success" for the operation ACCOUNT_MERGE_SUCCESS = 0, // codes considered as "failure" for the operation - ACCOUNT_MERGE_MALFORMED = 1, // can't merge onto itself - ACCOUNT_MERGE_NO_ACCOUNT = 2, // destination does not exist - ACCOUNT_MERGE_HAS_CREDIT = 3, // account has active trust lines - ACCOUNT_MERGE_CREDIT_HELD = 4 // an issuer cannot be merged if used + ACCOUNT_MERGE_MALFORMED = -1, // can't merge onto itself + ACCOUNT_MERGE_NO_ACCOUNT = -2, // destination does not exist + ACCOUNT_MERGE_HAS_CREDIT = -3, // account has active trust lines + ACCOUNT_MERGE_CREDIT_HELD = -4 // an issuer cannot be merged if used }; union AccountMergeResult switch (AccountMergeResultCode code) @@ -408,7 +410,7 @@ enum InflationResultCode // codes considered as "success" for the operation INFLATION_SUCCESS = 0, // codes considered as "failure" for the operation - INFLATION_NOT_TIME = 1 + INFLATION_NOT_TIME = -1 }; struct inflationPayout // or use PaymentResultAtom to limit types? @@ -431,8 +433,8 @@ enum OperationResultCode { opINNER = 0, // inner object result is valid - opBAD_AUTH = 1, // not enough signatures to perform operation - opNO_ACCOUNT = 2 // source account was not found + opBAD_AUTH = -1, // not enough signatures to perform operation + opNO_ACCOUNT = -2 // source account was not found }; union OperationResult switch (OperationResultCode code) @@ -464,20 +466,20 @@ enum TransactionResultCode { txSUCCESS = 0, // all operations succeeded - txDUPLICATE = 1, // transaction was already submited + txDUPLICATE = -1, // transaction was already submited - txFAILED = 2, // one of the operations failed (but none were applied) + txFAILED = -2, // one of the operations failed (but none were applied) - txBAD_LEDGER = 3, // ledger is not in range [minLeder; maxLedger] - txMISSING_OPERATION = 4, // no operation was specified - txBAD_SEQ = 5, // sequence number does not match source account + txBAD_LEDGER = -3, // ledger is not in range [minLeder; maxLedger] + txMISSING_OPERATION = -4, // no operation was specified + txBAD_SEQ = -5, // sequence number does not match source account - txBAD_AUTH = 6, // not enough signatures to perform transaction - txINSUFFICIENT_BALANCE = 7, // fee would bring account below reserve - txNO_ACCOUNT = 8, // source account not found - txINSUFFICIENT_FEE = 9, // max fee is too small - txBAD_AUTH_EXTRA = 10, // too many signatures on transaction - txINTERNAL_ERROR = 0xFFFFFFFF // an unknown error occured + txBAD_AUTH = -6, // not enough signatures to perform transaction + txINSUFFICIENT_BALANCE = -7, // fee would bring account below reserve + txNO_ACCOUNT = -8, // source account not found + txINSUFFICIENT_FEE = -9, // max fee is too small + txBAD_AUTH_EXTRA = -10, // too many signatures on transaction + txINTERNAL_ERROR = -11 // an unknown error occured }; struct TransactionResult