@@ -445,10 +445,10 @@ const LIQUIDITY_POOL_FEE_V18 = 30;
445
445
struct LiquidityPoolDepositOp
446
446
{
447
447
PoolID liquidityPoolID ;
448
- int64 maxAmountA ; // maximum amount of first asset to deposit
449
- int64 maxAmountB ; // maximum amount of second asset to deposit
450
- Price minPrice ; // minimum depositA/depositB
451
- Price maxPrice ; // maximum depositA/depositB
448
+ int64 maxAmountA ; // maximum amount of first asset to deposit
449
+ int64 maxAmountB ; // maximum amount of second asset to deposit
450
+ Price minPrice ; // minimum depositA/depositB
451
+ Price maxPrice ; // maximum depositA/depositB
452
452
};
453
453
454
454
/* Withdraw assets from a liquidity pool
@@ -460,9 +460,9 @@ struct LiquidityPoolDepositOp
460
460
struct LiquidityPoolWithdrawOp
461
461
{
462
462
PoolID liquidityPoolID ;
463
- int64 amount ; // amount of pool shares to withdraw
464
- int64 minAmountA ; // minimum amount of first asset to withdraw
465
- int64 minAmountB ; // minimum amount of second asset to withdraw
463
+ int64 amount ; // amount of pool shares to withdraw
464
+ int64 minAmountA ; // minimum amount of first asset to withdraw
465
+ int64 minAmountB ; // minimum amount of second asset to withdraw
466
466
};
467
467
468
468
/* An operation is the lowest unit of work that a transaction does */
@@ -582,21 +582,22 @@ struct LedgerBounds
582
582
uint32 maxLedger ; // 0 here means no maxLedger
583
583
};
584
584
585
- struct PreconditionsV2 {
586
- TimeBounds * timeBounds ;
585
+ struct PreconditionsV2
586
+ {
587
+ TimeBounds * timeBounds ;
587
588
588
589
// Transaction only valid for ledger numbers n such that
589
590
// minLedger <= n < maxLedger (if maxLedger == 0, then
590
591
// only minLedger is checked)
591
- LedgerBounds * ledgerBounds ;
592
+ LedgerBounds * ledgerBounds ;
592
593
593
594
// If NULL, only valid when sourceAccount's sequence number
594
595
// is seqNum - 1. Otherwise, valid when sourceAccount's
595
596
// sequence number n satisfies minSeqNum <= n < tx.seqNum.
596
597
// Note that after execution the account's sequence number
597
598
// is always raised to tx.seqNum, and a transaction is not
598
599
// valid if tx.seqNum is too high to ensure replay protection.
599
- SequenceNumber * minSeqNum ;
600
+ SequenceNumber * minSeqNum ;
600
601
601
602
// For the transaction to be valid, the current ledger time must
602
603
// be at least minSeqAge greater than sourceAccount's seqTime.
@@ -614,19 +615,21 @@ struct PreconditionsV2 {
614
615
SignerKey extraSigners < 2 > ;
615
616
};
616
617
617
- enum PreconditionType {
618
+ enum PreconditionType
619
+ {
618
620
PRECOND_NONE = 0 ,
619
621
PRECOND_TIME = 1 ,
620
622
PRECOND_V2 = 2
621
623
};
622
624
623
- union Preconditions switch (PreconditionType type ) {
624
- case PRECOND_NONE :
625
- void ;
626
- case PRECOND_TIME :
627
- TimeBounds timeBounds ;
628
- case PRECOND_V2 :
629
- PreconditionsV2 v2 ;
625
+ union Preconditions switch (PreconditionType type )
626
+ {
627
+ case PRECOND_NONE :
628
+ void ;
629
+ case PRECOND_TIME :
630
+ TimeBounds timeBounds ;
631
+ case PRECOND_V2 :
632
+ PreconditionsV2 v2 ;
630
633
};
631
634
632
635
// maximum number of operations per transaction
@@ -1107,10 +1110,12 @@ enum ChangeTrustResultCode
1107
1110
// cannot create with a limit of 0
1108
1111
CHANGE_TRUST_LOW_RESERVE =
1109
1112
-4 , // not enough funds to create a new trust line,
1110
- CHANGE_TRUST_SELF_NOT_ALLOWED = -5 , // trusting self is not allowed
1113
+ CHANGE_TRUST_SELF_NOT_ALLOWED = -5 , // trusting self is not allowed
1111
1114
CHANGE_TRUST_TRUST_LINE_MISSING = -6 , // Asset trustline is missing for pool
1112
- CHANGE_TRUST_CANNOT_DELETE = -7 , // Asset trustline is still referenced in a pool
1113
- CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES = -8 // Asset trustline is deauthorized
1115
+ CHANGE_TRUST_CANNOT_DELETE =
1116
+ -7 , // Asset trustline is still referenced in a pool
1117
+ CHANGE_TRUST_NOT_AUTH_MAINTAIN_LIABILITIES =
1118
+ -8 // Asset trustline is deauthorized
1114
1119
};
1115
1120
1116
1121
union ChangeTrustResult switch (ChangeTrustResultCode code )
@@ -1132,10 +1137,10 @@ enum AllowTrustResultCode
1132
1137
ALLOW_TRUST_NO_TRUST_LINE = -2 , // trustor does not have a trustline
1133
1138
// source account does not require trust
1134
1139
ALLOW_TRUST_TRUST_NOT_REQUIRED = -3 ,
1135
- ALLOW_TRUST_CANT_REVOKE = -4 , // source account can't revoke trust,
1140
+ ALLOW_TRUST_CANT_REVOKE = -4 , // source account can't revoke trust,
1136
1141
ALLOW_TRUST_SELF_NOT_ALLOWED = -5 , // trusting self is not allowed
1137
- ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created
1138
- // on revoke due to low reserves
1142
+ ALLOW_TRUST_LOW_RESERVE = -6 // claimable balances can't be created
1143
+ // on revoke due to low reserves
1139
1144
};
1140
1145
1141
1146
union AllowTrustResult switch (AllowTrustResultCode code )
@@ -1432,8 +1437,7 @@ enum LiquidityPoolDepositResultCode
1432
1437
LIQUIDITY_POOL_DEPOSIT_POOL_FULL = -7 // pool reserves are full
1433
1438
};
1434
1439
1435
- union LiquidityPoolDepositResult switch (
1436
- LiquidityPoolDepositResultCode code )
1440
+ union LiquidityPoolDepositResult switch (LiquidityPoolDepositResultCode code )
1437
1441
{
1438
1442
case LIQUIDITY_POOL_DEPOSIT_SUCCESS :
1439
1443
void ;
@@ -1449,18 +1453,17 @@ enum LiquidityPoolWithdrawResultCode
1449
1453
LIQUIDITY_POOL_WITHDRAW_SUCCESS = 0 ,
1450
1454
1451
1455
// codes considered as "failure" for the operation
1452
- LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1 , // bad input
1453
- LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2 , // no trust line for one of the
1454
- // assets
1455
- LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3 , // not enough balance of the
1456
- // pool share
1457
- LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4 , // would go above limit for one
1458
- // of the assets
1459
- LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough
1456
+ LIQUIDITY_POOL_WITHDRAW_MALFORMED = -1 , // bad input
1457
+ LIQUIDITY_POOL_WITHDRAW_NO_TRUST = -2 , // no trust line for one of the
1458
+ // assets
1459
+ LIQUIDITY_POOL_WITHDRAW_UNDERFUNDED = -3 , // not enough balance of the
1460
+ // pool share
1461
+ LIQUIDITY_POOL_WITHDRAW_LINE_FULL = -4 , // would go above limit for one
1462
+ // of the assets
1463
+ LIQUIDITY_POOL_WITHDRAW_UNDER_MINIMUM = -5 // didn't withdraw enough
1460
1464
};
1461
1465
1462
- union LiquidityPoolWithdrawResult switch (
1463
- LiquidityPoolWithdrawResultCode code )
1466
+ union LiquidityPoolWithdrawResult switch (LiquidityPoolWithdrawResultCode code )
1464
1467
{
1465
1468
case LIQUIDITY_POOL_WITHDRAW_SUCCESS :
1466
1469
void ;
@@ -1562,7 +1565,9 @@ enum TransactionResultCode
1562
1565
txNOT_SUPPORTED = -12 , // transaction type not supported
1563
1566
txFEE_BUMP_INNER_FAILED = -13 , // fee bump inner transaction failed
1564
1567
txBAD_SPONSORSHIP = -14 , // sponsorship not confirmed
1565
- txBAD_MIN_SEQ_AGE_OR_GAP = -15 //minSeqAge or minSeqLedgerGap conditions not met
1568
+ txBAD_MIN_SEQ_AGE_OR_GAP =
1569
+ -15 , // minSeqAge or minSeqLedgerGap conditions not met
1570
+ txMALFORMED = -16 // precondition is invalid
1566
1571
};
1567
1572
1568
1573
// InnerTransactionResult must be binary compatible with TransactionResult
@@ -1592,6 +1597,7 @@ struct InnerTransactionResult
1592
1597
// txFEE_BUMP_INNER_FAILED is not included
1593
1598
case txBAD_SPONSORSHIP :
1594
1599
case txBAD_MIN_SEQ_AGE_OR_GAP :
1600
+ case txMALFORMED :
1595
1601
void ;
1596
1602
}
1597
1603
result ;
0 commit comments