add DepositPreauth fields

This commit is contained in:
Matthew Fettig
2018-09-28 14:45:22 -05:00
parent e0a6473814
commit e99031d6af
5 changed files with 99 additions and 1 deletions

View File

@@ -36,6 +36,7 @@
"FeeSettings": 115,
"Escrow": 117,
"PayChannel": 120,
"DepositPreauth": 112,
"Check": 67,
"Nickname": 110,
"Contract": 99,
@@ -1062,6 +1063,26 @@
"type": "AccountID"
}
],
[
"Authorize",
{
"nth": 5,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"Unauthorize",
{
"nth": 6,
"isVLEncoded": true,
"isSerialized": true,
"isSigningField": true,
"type": "AccountID"
}
],
[
"Target",
{
@@ -1610,7 +1631,8 @@
"tecOVERSIZE": 145,
"tecCRYPTOCONDITION_ERROR": 146,
"tecINVARIANT_FAILED": 147,
"tecEXPIRED": 148
"tecEXPIRED": 148,
"tecDUPLICATE": 149
},
"TRANSACTION_TYPES": {
"Invalid": -1,
@@ -1633,6 +1655,7 @@
"CheckCreate": 16,
"CheckCash": 17,
"CheckCancel": 18,
"DepositPreauth": 19,
"TrustSet": 20,
"EnableAmendment": 100,
"SetFee": 101

View File

@@ -15,6 +15,11 @@ const SignerListSet = {
binary: require('./fixtures/signerlistset-tx-binary.json'),
meta: require('./fixtures/signerlistset-tx-meta-binary.json')
};
const DepositPreauth = {
tx: require('./fixtures/deposit-preauth-tx.json'),
binary: require('./fixtures/deposit-preauth-tx-binary.json'),
meta: require('./fixtures/deposit-preauth-tx-meta-binary.json')
};
const Escrow = {
create: {
tx: require('./fixtures/escrow-create-tx.json'),
@@ -135,6 +140,15 @@ function SignerListSetTest() {
});
}
function DepositPreauthTest() {
it('can serialize DepositPreauth', () => {
assert.strictEqual(encode(DepositPreauth.tx), DepositPreauth.binary);
});
it('can serialize DepositPreauth metadata', () => {
assert.strictEqual(encode(DepositPreauth.tx.meta), DepositPreauth.meta);
});
}
function EscrowTest() {
it('can serialize EscrowCreate', () => {
assert.strictEqual(encode(Escrow.create.tx),
@@ -173,6 +187,7 @@ describe('Binary Serialization', function() {
describe('UIntTest', UIntTest);
describe('BytesList', bytesListTest);
describe('DeliverMin', deliverMinTest);
describe('DepositPreauth', DepositPreauthTest);
describe('SignerListSet', SignerListSetTest);
describe('Escrow', EscrowTest);
describe('PaymentChannel', PaymentChannelTest);

View File

@@ -0,0 +1 @@
"1200132280000000240000004168400000000000000A732103EB1E2603E7571D6144684996C10DA75063D6E2F3B3FDABE38B857C1BE9578A5574473045022100B0A5672E3E09FA3AF8CF1DCC1D8C881F58B39212D6FDC42CCF30E5400D0EFD9F02202DDD9517D9409D1D9A529B8AEA7DE13AE4CDF96BB6D18FA0D9732DBFC887348D81148A928D14A643F388AC0D26BAF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0"

View File

@@ -0,0 +1 @@
"201C00000000F8E51100612500AE5F59558107CEE99D556326ACD4662CA10A24550240D9F933E55435A0C0DB3B06DD343E56146AAAF7A266D8A92DFFEAB1A71B6523534F27820873F4E213014B23398867D2E624000000412D00000007624000000249CB5DD0E1E7220000000024000000422D00000008624000000249CB5DC681148A928D14A643F388AC0D26BAF9755B07EB0A2B44E1E1E311007056C2D0317AD266B93CB3B36AEB0ABB673B0AFFAB134809CCACFD7158F539603C3AE881148A928D14A643F388AC0D26BAF9755B07EB0A2B44851486FFE2A17E861BA0FE9A3ED8352F895D80E789E0E1E1E511006456CD08416851CA53E9649408118A4908E01E43436ED950886D1B1E66F4B68B82ECE7220000000058CD08416851CA53E9649408118A4908E01E43436ED950886D1B1E66F4B68B82EC82148A928D14A643F388AC0D26BAF9755B07EB0A2B44E1E1F1031000"

View File

@@ -0,0 +1,58 @@
{
"Account": "rDd6FpNbeY2CrQajSmP178BmNGusmQiYMM",
"Authorize": "rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM",
"Fee": "10",
"Flags": 2147483648,
"Sequence": 65,
"SigningPubKey": "03EB1E2603E7571D6144684996C10DA75063D6E2F3B3FDABE38B857C1BE9578A55",
"TransactionType": "DepositPreauth",
"TxnSignature": "3045022100B0A5672E3E09FA3AF8CF1DCC1D8C881F58B39212D6FDC42CCF30E5400D0EFD9F02202DDD9517D9409D1D9A529B8AEA7DE13AE4CDF96BB6D18FA0D9732DBFC887348D",
"hash": "B5D94C027C846171B2F5D4C2D126E88580BF369986A155C1890352F5BC4D7AF9",
"meta": {
"AffectedNodes": [
{
"ModifiedNode": {
"FinalFields": {
"Account": "rDd6FpNbeY2CrQajSmP178BmNGusmQiYMM",
"Balance": "9827999174",
"Flags": 0,
"OwnerCount": 8,
"Sequence": 66
},
"LedgerEntryType": "AccountRoot",
"LedgerIndex": "146AAAF7A266D8A92DFFEAB1A71B6523534F27820873F4E213014B23398867D2",
"PreviousFields": {
"Balance": "9827999184",
"OwnerCount": 7,
"Sequence": 65
},
"PreviousTxnID": "8107CEE99D556326ACD4662CA10A24550240D9F933E55435A0C0DB3B06DD343E",
"PreviousTxnLgrSeq": 11427673
}
},
{
"CreatedNode": {
"LedgerEntryType": "DepositPreauth",
"LedgerIndex": "C2D0317AD266B93CB3B36AEB0ABB673B0AFFAB134809CCACFD7158F539603C3A",
"NewFields": {
"Account": "rDd6FpNbeY2CrQajSmP178BmNGusmQiYMM",
"Authorize": "rDJFnv5sEfp42LMFiX3mVQKczpFTdxYDzM"
}
}
},
{
"ModifiedNode": {
"FinalFields": {
"Flags": 0,
"Owner": "rDd6FpNbeY2CrQajSmP178BmNGusmQiYMM",
"RootIndex": "CD08416851CA53E9649408118A4908E01E43436ED950886D1B1E66F4B68B82EC"
},
"LedgerEntryType": "DirectoryNode",
"LedgerIndex": "CD08416851CA53E9649408118A4908E01E43436ED950886D1B1E66F4B68B82EC"
}
}
],
"TransactionIndex": 0,
"TransactionResult": "tesSUCCESS"
}
}