xrpl_std/host/
host_bindings_for_testing.rs

1// This file exists as a host_binding stand-in for non-WASM targets. For example, this file will
2// be used during unit tests.
3
4//TODO add docs after discussing the interface
5//Note that Craft currently does not honor the rounding modes
6//TODO discuss reason for this file
7#[allow(unused)]
8pub const FLOAT_ROUNDING_MODES_TO_NEAREST: i32 = 0;
9#[allow(unused)]
10pub const FLOAT_ROUNDING_MODES_TOWARDS_ZERO: i32 = 1;
11#[allow(unused)]
12pub const FLOAT_ROUNDING_MODES_DOWNWARD: i32 = 2;
13#[allow(unused)]
14pub const FLOAT_ROUNDING_MODES_UPWARD: i32 = 3;
15
16#[allow(unused)]
17#[allow(clippy::missing_safety_doc)]
18pub unsafe fn get_ledger_sqn(_out_buff_ptr: *mut u8, _out_buff_len: usize) -> i32 {
19    -1
20}
21
22#[allow(unused)]
23#[allow(clippy::missing_safety_doc)]
24pub unsafe fn get_parent_ledger_time(_out_buff_ptr: *mut u8, _out_buff_len: usize) -> i32 {
25    -1
26}
27
28#[allow(unused)]
29#[allow(clippy::missing_safety_doc)]
30pub unsafe fn get_parent_ledger_hash(_out_buff_ptr: *mut u8, _out_buff_len: usize) -> i32 {
31    -1
32}
33
34#[allow(unused)]
35#[allow(clippy::missing_safety_doc)]
36pub unsafe fn get_ledger_account_hash(_out_buff_ptr: *mut u8, _out_buff_len: usize) -> i32 {
37    -1
38}
39
40#[allow(unused)]
41#[allow(clippy::missing_safety_doc)]
42pub unsafe fn get_ledger_tx_hash(_out_buff_ptr: *mut u8, _out_buff_len: usize) -> i32 {
43    -1
44}
45
46#[allow(unused)]
47#[allow(clippy::missing_safety_doc)]
48pub unsafe fn get_base_fee() -> i32 {
49    -1
50}
51
52#[allow(unused)]
53#[allow(clippy::missing_safety_doc)]
54pub unsafe fn amendment_enabled(_amendment_ptr: *const u8, _amendment_len: usize) -> i32 {
55    -1
56}
57
58#[allow(unused)]
59#[allow(clippy::missing_safety_doc)]
60pub unsafe fn cache_ledger_obj(_keylet_ptr: *const u8, _keylet_len: usize, _cache_num: i32) -> i32 {
61    -1
62}
63
64#[allow(unused)]
65#[allow(clippy::missing_safety_doc)]
66pub unsafe fn get_tx_field(_field: i32, _out_buff_ptr: *mut u8, _out_buff_len: usize) -> i32 {
67    -1
68}
69
70#[allow(unused)]
71#[allow(clippy::missing_safety_doc)]
72pub unsafe fn get_current_ledger_obj_field(
73    _field: i32,
74    _out_buff_ptr: *mut u8,
75    _out_buff_len: usize,
76) -> i32 {
77    -1
78}
79
80#[allow(unused)]
81#[allow(clippy::missing_safety_doc)]
82pub unsafe fn get_ledger_obj_field(
83    _cache_num: i32,
84    _field: i32,
85    _out_buff_ptr: *mut u8,
86    _out_buff_len: usize,
87) -> i32 {
88    -1
89}
90
91#[allow(unused)]
92#[allow(clippy::missing_safety_doc)]
93pub unsafe fn get_tx_nested_field(
94    _locator_ptr: *const u8,
95    _locator_len: usize,
96    _out_buff_ptr: *mut u8,
97    _out_buff_len: usize,
98) -> i32 {
99    -1
100}
101
102#[allow(unused)]
103#[allow(clippy::missing_safety_doc)]
104pub unsafe fn get_current_ledger_obj_nested_field(
105    _locator_ptr: *const u8,
106    _locator_len: usize,
107    _out_buff_ptr: *mut u8,
108    _out_buff_len: usize,
109) -> i32 {
110    -1
111}
112
113#[allow(unused)]
114#[allow(clippy::missing_safety_doc)]
115pub unsafe fn get_ledger_obj_nested_field(
116    _cache_num: i32,
117    _locator_ptr: *const u8,
118    _locator_len: usize,
119    _out_buff_ptr: *mut u8,
120    _out_buff_len: usize,
121) -> i32 {
122    -1
123}
124
125#[allow(unused)]
126#[allow(clippy::missing_safety_doc)]
127pub unsafe fn get_tx_array_len(_field: i32) -> i32 {
128    -1
129}
130
131#[allow(unused)]
132#[allow(clippy::missing_safety_doc)]
133pub unsafe fn get_current_ledger_obj_array_len(_field: i32) -> i32 {
134    -1
135}
136
137#[allow(unused)]
138#[allow(clippy::missing_safety_doc)]
139pub unsafe fn get_ledger_obj_array_len(_cache_num: i32, _field: i32) -> i32 {
140    -1
141}
142
143#[allow(unused)]
144#[allow(clippy::missing_safety_doc)]
145pub unsafe fn get_tx_nested_array_len(_locator_ptr: *const u8, _locator_len: usize) -> i32 {
146    -1
147}
148
149#[allow(unused)]
150#[allow(clippy::missing_safety_doc)]
151pub unsafe fn get_current_ledger_obj_nested_array_len(
152    _locator_ptr: *const u8,
153    _locator_len: usize,
154) -> i32 {
155    -1
156}
157
158#[allow(unused)]
159#[allow(clippy::missing_safety_doc)]
160pub unsafe fn get_ledger_obj_nested_array_len(
161    _cache_num: i32,
162    _locator_ptr: *const u8,
163    _locator_len: usize,
164) -> i32 {
165    -1
166}
167
168#[allow(unused)]
169#[allow(clippy::missing_safety_doc)]
170pub unsafe fn update_data(_data_ptr: *const u8, _data_len: usize) -> i32 {
171    -1
172}
173
174#[allow(unused)]
175#[allow(clippy::missing_safety_doc)]
176pub unsafe fn compute_sha512_half(
177    _data_ptr: *const u8,
178    _data_len: usize,
179    _out_buff_ptr: *mut u8,
180    _out_buff_len: usize,
181) -> i32 {
182    -1
183}
184
185#[allow(unused)]
186#[allow(clippy::missing_safety_doc)]
187pub unsafe fn check_sig(
188    _message_ptr: *const u8,
189    _message_len: usize,
190    _signature_ptr: *const u8,
191    _signature_len: usize,
192    _pubkey_ptr: *const u8,
193    _pubkey_len: usize,
194) -> i32 {
195    -1
196}
197
198#[allow(unused)]
199#[allow(clippy::missing_safety_doc)]
200pub unsafe fn account_keylet(
201    _account_ptr: *const u8,
202    _account_len: usize,
203    _out_buff_ptr: *mut u8,
204    _out_buff_len: usize,
205) -> i32 {
206    32
207}
208
209#[allow(unused)]
210#[allow(clippy::missing_safety_doc)]
211pub unsafe fn check_keylet(
212    _account_ptr: *const u8,
213    _account_len: usize,
214    _sequence: i32,
215    _out_buff_ptr: *mut u8,
216    _out_buff_len: usize,
217) -> i32 {
218    32
219}
220
221#[allow(unused)]
222#[allow(clippy::too_many_arguments)]
223#[allow(clippy::missing_safety_doc)]
224pub unsafe fn credential_keylet(
225    _subject_ptr: *const u8,
226    _subject_len: usize,
227    _issuer_ptr: *const u8,
228    _issuer_len: usize,
229    _cred_type_ptr: *const u8,
230    _cred_type_len: usize,
231    _out_buff_ptr: *mut u8,
232    _out_buff_len: usize,
233) -> i32 {
234    32
235}
236
237#[allow(unused)]
238#[allow(clippy::missing_safety_doc)]
239pub unsafe fn delegate_keylet(
240    _account_ptr: *const u8,
241    _account_len: usize,
242    _authorize_ptr: *const u8,
243    _authorize_len: usize,
244    _out_buff_ptr: *mut u8,
245    _out_buff_len: usize,
246) -> i32 {
247    32
248}
249
250#[allow(unused)]
251#[allow(clippy::missing_safety_doc)]
252pub unsafe fn deposit_preauth_keylet(
253    _account_ptr: *const u8,
254    _account_len: usize,
255    _authorize_ptr: *const u8,
256    _authorize_len: usize,
257    _out_buff_ptr: *mut u8,
258    _out_buff_len: usize,
259) -> i32 {
260    32
261}
262
263#[allow(unused)]
264#[allow(clippy::missing_safety_doc)]
265pub unsafe fn did_keylet(
266    _account_ptr: *const u8,
267    _account_len: usize,
268    _out_buff_ptr: *mut u8,
269    _out_buff_len: usize,
270) -> i32 {
271    32
272}
273
274#[allow(unused)]
275#[allow(clippy::missing_safety_doc)]
276pub unsafe fn escrow_keylet(
277    _account_ptr: *const u8,
278    _account_len: usize,
279    _sequence: i32,
280    _out_buff_ptr: *mut u8,
281    _out_buff_len: usize,
282) -> i32 {
283    32
284}
285
286#[allow(unused)]
287#[allow(clippy::too_many_arguments)]
288#[allow(clippy::missing_safety_doc)]
289pub unsafe fn line_keylet(
290    _account1_ptr: *const u8,
291    _account1_len: usize,
292    _account2_ptr: *const u8,
293    _account2_len: usize,
294    _currency_ptr: *const u8,
295    _currency_len: usize,
296    _out_buff_ptr: *mut u8,
297    _out_buff_len: usize,
298) -> i32 {
299    32
300}
301
302#[allow(unused)]
303#[allow(clippy::missing_safety_doc)]
304pub unsafe fn nft_offer_keylet(
305    _account_ptr: *const u8,
306    _account_len: usize,
307    _sequence: i32,
308    _out_buff_ptr: *mut u8,
309    _out_buff_len: usize,
310) -> i32 {
311    32
312}
313
314#[allow(unused)]
315#[allow(clippy::missing_safety_doc)]
316pub unsafe fn offer_keylet(
317    _account_ptr: *const u8,
318    _account_len: usize,
319    _sequence: i32,
320    _out_buff_ptr: *mut u8,
321    _out_buff_len: usize,
322) -> i32 {
323    32
324}
325
326#[allow(unused)]
327#[allow(clippy::missing_safety_doc)]
328pub unsafe fn oracle_keylet(
329    _account_ptr: *const u8,
330    _account_len: usize,
331    _document_id: i32,
332    _out_buff_ptr: *mut u8,
333    _out_buff_len: usize,
334) -> i32 {
335    32
336}
337
338#[allow(unused)]
339#[allow(clippy::missing_safety_doc)]
340pub unsafe fn paychan_keylet(
341    _account_ptr: *const u8,
342    _account_len: usize,
343    _destination_ptr: *const u8,
344    _destination_len: usize,
345    _sequence: i32,
346    _out_buff_ptr: *mut u8,
347    _out_buff_len: usize,
348) -> i32 {
349    32
350}
351
352#[allow(unused)]
353#[allow(clippy::missing_safety_doc)]
354pub unsafe fn signers_keylet(
355    _account_ptr: *const u8,
356    _account_len: usize,
357    _out_buff_ptr: *mut u8,
358    _out_buff_len: usize,
359) -> i32 {
360    32
361}
362
363#[allow(unused)]
364#[allow(clippy::missing_safety_doc)]
365pub unsafe fn ticket_keylet(
366    _account_ptr: *const u8,
367    _account_len: usize,
368    _sequence: i32,
369    _out_buff_ptr: *mut u8,
370    _out_buff_len: usize,
371) -> i32 {
372    32
373}
374
375#[allow(unused)]
376#[allow(clippy::missing_safety_doc)]
377pub unsafe fn get_nft(
378    _account_ptr: *const u8,
379    _account_len: usize,
380    _nft_id_ptr: *const u8,
381    _nft_id_len: usize,
382    _out_buff_ptr: *mut u8,
383    _out_buff_len: usize,
384) -> i32 {
385    -1
386}
387
388#[allow(unused)]
389#[allow(clippy::missing_safety_doc)]
390pub unsafe fn get_nft_issuer(
391    _nft_id_ptr: *const u8,
392    _nft_id_len: usize,
393    _out_buff_ptr: *mut u8,
394    _out_buff_len: usize,
395) -> i32 {
396    -1
397}
398
399#[allow(unused)]
400#[allow(clippy::missing_safety_doc)]
401pub unsafe fn get_nft_taxon(
402    _nft_id_ptr: *const u8,
403    _nft_id_len: usize,
404    _out_buff_ptr: *mut u8,
405    _out_buff_len: usize,
406) -> i32 {
407    -1
408}
409
410#[allow(unused)]
411#[allow(clippy::missing_safety_doc)]
412pub unsafe fn get_nft_flags(_nft_id_ptr: *const u8, _nft_id_len: usize) -> i32 {
413    -1
414}
415
416#[allow(unused)]
417#[allow(clippy::missing_safety_doc)]
418pub unsafe fn get_nft_transfer_fee(_nft_id_ptr: *const u8, _nft_id_len: usize) -> i32 {
419    -1
420}
421
422#[allow(unused)]
423#[allow(clippy::missing_safety_doc)]
424pub unsafe fn get_nft_serial(
425    _nft_id_ptr: *const u8,
426    _nft_id_len: usize,
427    _out_buff_ptr: *mut u8,
428    _out_buff_len: usize,
429) -> i32 {
430    -1
431}
432
433#[allow(unused)]
434#[allow(clippy::missing_safety_doc)]
435pub unsafe fn trace(
436    _msg_read_ptr: *const u8,
437    _msg_read_len: usize,
438    _data_read_ptr: *const u8,
439    _data_read_len: usize,
440    _as_hex: i32,
441) -> i32 {
442    -1
443}
444
445#[allow(unused)]
446#[allow(clippy::missing_safety_doc)]
447pub unsafe fn trace_num(_msg_read_ptr: *const u8, _msg_read_len: usize, _number: i64) -> i32 {
448    -1
449}
450
451#[allow(unused)]
452#[allow(clippy::missing_safety_doc)]
453pub unsafe fn float_from_int(
454    in_int: i64,
455    out_buff: *mut u8,
456    out_buff_len: usize,
457    rounding_mode: i32,
458) -> i32 {
459    -1
460}
461
462#[allow(unused)]
463#[allow(clippy::missing_safety_doc)]
464pub unsafe fn float_from_uint(
465    in_uint_ptr: *const u8,
466    in_uint_len: usize,
467    out_buff: *mut u8,
468    out_buff_len: usize,
469    rounding_mode: i32,
470) -> i32 {
471    -1
472}
473
474#[allow(unused)]
475#[allow(clippy::missing_safety_doc)]
476pub unsafe fn float_set(
477    exponent: i32,
478    mantissa: i64,
479    out_buff: *mut u8,
480    out_buff_len: usize,
481    rounding_mode: i32,
482) -> i32 {
483    -1
484}
485
486#[allow(unused)]
487#[allow(clippy::missing_safety_doc)]
488pub unsafe fn float_compare(
489    in_buff1: *const u8,
490    in_buff1_len: usize,
491    in_buff2: *const u8,
492    in_buff2_len: usize,
493) -> i32 {
494    -1
495}
496
497#[allow(unused)]
498#[allow(clippy::missing_safety_doc)]
499pub unsafe fn float_add(
500    in_buff1: *const u8,
501    in_buff1_len: usize,
502    in_buff2: *const u8,
503    in_buff2_len: usize,
504    out_buff: *mut u8,
505    out_buff_len: usize,
506    rounding_mode: i32,
507) -> i32 {
508    -1
509}
510
511#[allow(unused)]
512#[allow(clippy::missing_safety_doc)]
513pub unsafe fn float_subtract(
514    in_buff1: *const u8,
515    in_buff1_len: usize,
516    in_buff2: *const u8,
517    in_buff2_len: usize,
518    out_buff: *mut u8,
519    out_buff_len: usize,
520    rounding_mode: i32,
521) -> i32 {
522    -1
523}
524
525#[allow(unused)]
526#[allow(clippy::missing_safety_doc)]
527pub unsafe fn float_multiply(
528    in_buff1: *const u8,
529    in_buff1_len: usize,
530    in_buff2: *const u8,
531    in_buff2_len: usize,
532    out_buff: *mut u8,
533    out_buff_len: usize,
534    rounding_mode: i32,
535) -> i32 {
536    -1
537}
538
539#[allow(unused)]
540#[allow(clippy::missing_safety_doc)]
541pub unsafe fn float_divide(
542    in_buff1: *const u8,
543    in_buff1_len: usize,
544    in_buff2: *const u8,
545    in_buff2_len: usize,
546    out_buff: *mut u8,
547    out_buff_len: usize,
548    rounding_mode: i32,
549) -> i32 {
550    -1
551}
552
553#[allow(unused)]
554#[allow(clippy::missing_safety_doc)]
555pub unsafe fn float_pow(
556    in_buff: *const u8,
557    in_buff_len: usize,
558    in_int: i32,
559    out_buff: *mut u8,
560    out_buff_len: usize,
561    rounding_mode: i32,
562) -> i32 {
563    -1
564}
565
566#[allow(unused)]
567#[allow(clippy::missing_safety_doc)]
568pub unsafe fn float_root(
569    in_buff: *const u8,
570    in_buff_len: usize,
571    in_int: i32,
572    out_buff: *mut u8,
573    out_buff_len: usize,
574    rounding_mode: i32,
575) -> i32 {
576    -1
577}
578
579#[allow(unused)]
580#[allow(clippy::missing_safety_doc)]
581pub unsafe fn float_log(
582    in_buff: *const u8,
583    in_buff_len: usize,
584    out_buff: *mut u8,
585    out_buff_len: usize,
586    rounding_mode: i32,
587) -> i32 {
588    -1
589}
590
591#[allow(unused)]
592#[allow(clippy::missing_safety_doc)]
593pub unsafe fn trace_opaque_float(
594    msg_read_ptr: *const u8,
595    msg_read_len: usize,
596    opaque_float_ptr: *const u8,
597    opaque_float_len: usize,
598) -> i32 {
599    -1
600}