Skip to content

Commit 4197879

Browse files
authored
add missing flags (#1212)
## High Level Overview of Change Add `tfSetDeepFreeze` and `tfClearDeepFreeze` flags to TrustSet transaction. <!-- Please include a summary/list of the changes. If too broad, please consider splitting into multiple PRs. --> ### Context of Change <!-- Please include the context of a change. If a bug fix, when was the bug introduced? What was the behavior? If a new feature, why was this architecture chosen? What were the alternatives? If a refactor, how is this better than the previous implementation? If there is a design document for this feature, please link it here. --> ### Type of Change <!-- Please check relevant options, delete irrelevant ones. --> - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Refactor (non-breaking change that only restructures code) - [x] Tests (You added tests for code that already exists, or your new feature included in this PR) - [ ] Documentation Updates - [ ] Translation Updates - [ ] Release ### Codebase Modernization <!-- In an effort to modernize the codebase, you should convert the files that you work with to React Hooks and TypeScript, and update tests to use the React Testing Library instead of Enzyme. If this is not possible (e.g. it's too many changes, touching too many files, etc.) please explain why here. --> - [ ] Updated files to React Hooks - [ ] Updated files to TypeScript - [ ] Updated tests to React Testing Library ## Before / After <!-- If just refactoring / back-end changes, this can be just an in-English description of the change at a technical level. If a UI change, screenshots should be included. --> ## Test Plan <img width="1250" height="736" alt="image" src="https://github.com/user-attachments/assets/fe4d1fb1-6cc5-4b58-b5b1-08fd5d8a52c1" /> <!-- Please describe the tests that you ran to verify your changes and provide instructions so that others can reproduce. --> <!-- ## Future Tasks For future tasks related to PR. -->
1 parent 3cbc982 commit 4197879

File tree

3 files changed

+168
-0
lines changed

3 files changed

+168
-0
lines changed

src/containers/Transactions/test/DetailTab.test.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Transaction from '../../shared/components/Transaction/EscrowCreate/test/m
66
import FailedTransaction from '../../shared/components/Transaction/SignerListSet/test/mock_data/SignerListSet.json'
77
import HookPayment from './mock_data/HookPayment.json'
88
import EmittedPayment from './mock_data/EmittedPayment.json'
9+
import TrustSet from './mock_data/TrustSet.json'
910
import { DetailTab } from '../DetailTab'
1011
import i18n from '../../../i18n/testConfigEnglish'
1112
import { convertHexToString } from '../../../rippled/lib/utils'
@@ -169,4 +170,29 @@ describe('DetailTab container', () => {
169170
'Emitted 0 transactions',
170171
)
171172
})
173+
174+
it('renders flags', () => {
175+
const wrapper = createWrapper(TrustSet)
176+
const expectedFlags = new Set([
177+
'tfFullyCanonicalSig',
178+
'tfSetDeepFreeze',
179+
'tfSetFreeze',
180+
'tfSetAuth',
181+
])
182+
183+
expect(wrapper.contains(<div className="title">Flags</div>)).toBe(true)
184+
185+
expect(wrapper.find('.detail-section .flags').children()).toHaveLength(
186+
expectedFlags.size,
187+
)
188+
189+
const renderedFlags = wrapper
190+
.find('.detail-section .flags')
191+
.children()
192+
.map((node) => node.text())
193+
194+
expect(new Set(renderedFlags)).toEqual(expectedFlags)
195+
196+
wrapper.unmount()
197+
})
172198
})
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"tx": {
3+
"Account": "rLwNAmcqi7ipSZ5cUc6zXZMjwEddr2yc8x",
4+
"Fee": "10",
5+
"Flags": 2152792064,
6+
"LimitAmount": {
7+
"currency": "EQT",
8+
"issuer": "rBeb4FLPG4XUwxdnnEztTLK6Zd9mxhDQ6E",
9+
"value": "0"
10+
},
11+
"Sequence": 9198426,
12+
"SigningPubKey": "025CE5B77DBE302A3CF37D23DD2478A5F36349108BB4652422D858DAFE72284282",
13+
"SourceTag": 608402356,
14+
"TransactionType": "TrustSet",
15+
"TxnSignature": "30440220537A17DA2BD39101DE1978067CA17469E40D898ED7D2E360B8865A784F4E0B9602205A4BE189A12DA11C8D2F452FBF0CE1EBC6EC6FE44EAD0E198C66B8B1DF04ACB1",
16+
"ctid": "C08C5FEE00010001",
17+
"date": 1753466092000,
18+
"hash": "F7F89216FDB0135847BB4966607ACCABF7555302DC8143D2E1C71FEA9249AF3E",
19+
"inLedger": 9199598,
20+
"ledger_index": 9199598,
21+
"meta": {
22+
"AffectedNodes": [
23+
{
24+
"ModifiedNode": {
25+
"FinalFields": {
26+
"Balance": {
27+
"currency": "EQT",
28+
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
29+
"value": "1"
30+
},
31+
"Flags": 77266944,
32+
"HighLimit": {
33+
"currency": "EQT",
34+
"issuer": "rLwNAmcqi7ipSZ5cUc6zXZMjwEddr2yc8x",
35+
"value": "0"
36+
},
37+
"HighNode": "0",
38+
"LowLimit": {
39+
"currency": "EQT",
40+
"issuer": "rBeb4FLPG4XUwxdnnEztTLK6Zd9mxhDQ6E",
41+
"value": "100000"
42+
},
43+
"LowNode": "0"
44+
},
45+
"LedgerEntryType": "RippleState",
46+
"LedgerIndex": "66C42DF2F527BA73BE6AD7E20A5BBC81A39A0A9DD9AE21FE7E3FC6EDA8593E88",
47+
"PreviousFields": {
48+
"Flags": 1638400
49+
},
50+
"PreviousTxnID": "0CEFFA595E230BED9BD23E0A32B594DB0781AE5C4315FC8BA673B278001F0163",
51+
"PreviousTxnLgrSeq": 9199409
52+
}
53+
},
54+
{
55+
"ModifiedNode": {
56+
"FinalFields": {
57+
"Account": "rLwNAmcqi7ipSZ5cUc6zXZMjwEddr2yc8x",
58+
"Balance": "21999940",
59+
"Flags": 2156134400,
60+
"OwnerCount": 2,
61+
"Sequence": 9198427
62+
},
63+
"LedgerEntryType": "AccountRoot",
64+
"LedgerIndex": "C1C8011AE06D1DD364D7091702BAE8DAF921235FD7E462DAAF00F59D9353E580",
65+
"PreviousFields": {
66+
"Balance": "21999950",
67+
"OwnerCount": 1,
68+
"Sequence": 9198426
69+
},
70+
"PreviousTxnID": "7A85D2343EB6A7C8D10088351B59210213A0616B353CA841B4806A7024CED8B7",
71+
"PreviousTxnLgrSeq": 9199406
72+
}
73+
}
74+
],
75+
"TransactionIndex": 1,
76+
"TransactionResult": "tesSUCCESS"
77+
},
78+
"validated": true
79+
},
80+
"meta": {
81+
"AffectedNodes": [
82+
{
83+
"ModifiedNode": {
84+
"FinalFields": {
85+
"Balance": {
86+
"currency": "EQT",
87+
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
88+
"value": "1"
89+
},
90+
"Flags": 77266944,
91+
"HighLimit": {
92+
"currency": "EQT",
93+
"issuer": "rLwNAmcqi7ipSZ5cUc6zXZMjwEddr2yc8x",
94+
"value": "0"
95+
},
96+
"HighNode": "0",
97+
"LowLimit": {
98+
"currency": "EQT",
99+
"issuer": "rBeb4FLPG4XUwxdnnEztTLK6Zd9mxhDQ6E",
100+
"value": "100000"
101+
},
102+
"LowNode": "0"
103+
},
104+
"LedgerEntryType": "RippleState",
105+
"LedgerIndex": "66C42DF2F527BA73BE6AD7E20A5BBC81A39A0A9DD9AE21FE7E3FC6EDA8593E88",
106+
"PreviousFields": {
107+
"Flags": 1638400
108+
},
109+
"PreviousTxnID": "0CEFFA595E230BED9BD23E0A32B594DB0781AE5C4315FC8BA673B278001F0163",
110+
"PreviousTxnLgrSeq": 9199409
111+
}
112+
},
113+
{
114+
"ModifiedNode": {
115+
"FinalFields": {
116+
"Account": "rLwNAmcqi7ipSZ5cUc6zXZMjwEddr2yc8x",
117+
"Balance": "21999940",
118+
"Flags": 2156134400,
119+
"OwnerCount": 2,
120+
"Sequence": 9198427
121+
},
122+
"LedgerEntryType": "AccountRoot",
123+
"LedgerIndex": "C1C8011AE06D1DD364D7091702BAE8DAF921235FD7E462DAAF00F59D9353E580",
124+
"PreviousFields": {
125+
"Balance": "21999950",
126+
"OwnerCount": 1,
127+
"Sequence": 9198426
128+
},
129+
"PreviousTxnID": "7A85D2343EB6A7C8D10088351B59210213A0616B353CA841B4806A7024CED8B7",
130+
"PreviousTxnLgrSeq": 9199406
131+
}
132+
}
133+
],
134+
"TransactionIndex": 1,
135+
"TransactionResult": "tesSUCCESS"
136+
},
137+
"hash": "F7F89216FDB0135847BB4966607ACCABF7555302DC8143D2E1C71FEA9249AF3E",
138+
"ledger_index": 9199598,
139+
"date": 1753466092000
140+
}

src/containers/shared/transactionUtils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export const TX_FLAGS: Record<string, Record<number, string>> = {
9393
0x00040000: 'tfClearNoRipple',
9494
0x00100000: 'tfSetFreeze',
9595
0x00200000: 'tfClearFreeze',
96+
0x00400000: 'tfSetDeepFreeze',
97+
0x00800000: 'tfClearDeepFreeze',
9698
},
9799
XChainModifyBridge: {
98100
0x00010000: 'tfClearAccountCreateAmount',

0 commit comments

Comments
 (0)