xrpl_wasm_stdlib/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#[allow(unused)]
5#[allow(clippy::missing_safety_doc)]
6pub unsafe fn get_ledger_sqn() -> i32 {
7    -1
8}
9
10#[allow(unused)]
11#[allow(clippy::missing_safety_doc)]
12pub unsafe fn get_parent_ledger_time() -> i32 {
13    -1
14}
15
16#[allow(unused)]
17#[allow(clippy::missing_safety_doc)]
18pub unsafe fn get_parent_ledger_hash(_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_base_fee() -> i32 {
25    -1
26}
27
28#[allow(unused)]
29#[allow(clippy::missing_safety_doc)]
30pub unsafe fn amendment_enabled(_amendment_ptr: *const u8, _amendment_len: usize) -> i32 {
31    -1
32}
33
34#[allow(unused)]
35#[allow(clippy::missing_safety_doc)]
36pub unsafe fn cache_ledger_obj(_keylet_ptr: *const u8, _keylet_len: usize, _cache_num: i32) -> i32 {
37    -1
38}
39
40#[allow(unused)]
41#[allow(clippy::missing_safety_doc)]
42pub unsafe fn get_tx_field(_field: i32, _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_current_ledger_obj_field(
49    _field: i32,
50    _out_buff_ptr: *mut u8,
51    _out_buff_len: usize,
52) -> i32 {
53    -1
54}
55
56#[allow(unused)]
57#[allow(clippy::missing_safety_doc)]
58pub unsafe fn get_ledger_obj_field(
59    _cache_num: i32,
60    _field: i32,
61    _out_buff_ptr: *mut u8,
62    _out_buff_len: usize,
63) -> i32 {
64    -1
65}
66
67#[allow(unused)]
68#[allow(clippy::missing_safety_doc)]
69pub unsafe fn get_tx_nested_field(
70    _locator_ptr: *const u8,
71    _locator_len: usize,
72    _out_buff_ptr: *mut u8,
73    _out_buff_len: usize,
74) -> i32 {
75    -1
76}
77
78#[allow(unused)]
79#[allow(clippy::missing_safety_doc)]
80pub unsafe fn get_current_ledger_obj_nested_field(
81    _locator_ptr: *const u8,
82    _locator_len: usize,
83    _out_buff_ptr: *mut u8,
84    _out_buff_len: usize,
85) -> i32 {
86    -1
87}
88
89#[allow(unused)]
90#[allow(clippy::missing_safety_doc)]
91pub unsafe fn get_ledger_obj_nested_field(
92    _cache_num: i32,
93    _locator_ptr: *const u8,
94    _locator_len: usize,
95    _out_buff_ptr: *mut u8,
96    _out_buff_len: usize,
97) -> i32 {
98    -1
99}
100
101#[allow(unused)]
102#[allow(clippy::missing_safety_doc)]
103pub unsafe fn get_tx_array_len(_field: i32) -> i32 {
104    -1
105}
106
107#[allow(unused)]
108#[allow(clippy::missing_safety_doc)]
109pub unsafe fn get_current_ledger_obj_array_len(_field: i32) -> i32 {
110    -1
111}
112
113#[allow(unused)]
114#[allow(clippy::missing_safety_doc)]
115pub unsafe fn get_ledger_obj_array_len(_cache_num: i32, _field: i32) -> i32 {
116    -1
117}
118
119#[allow(unused)]
120#[allow(clippy::missing_safety_doc)]
121pub unsafe fn get_tx_nested_array_len(_locator_ptr: *const u8, _locator_len: usize) -> i32 {
122    -1
123}
124
125#[allow(unused)]
126#[allow(clippy::missing_safety_doc)]
127pub unsafe fn get_current_ledger_obj_nested_array_len(
128    _locator_ptr: *const u8,
129    _locator_len: usize,
130) -> i32 {
131    -1
132}
133
134#[allow(unused)]
135#[allow(clippy::missing_safety_doc)]
136pub unsafe fn get_ledger_obj_nested_array_len(
137    _cache_num: i32,
138    _locator_ptr: *const u8,
139    _locator_len: usize,
140) -> i32 {
141    -1
142}
143
144#[allow(unused)]
145#[allow(clippy::missing_safety_doc)]
146pub unsafe fn update_data(_data_ptr: *const u8, _data_len: usize) -> i32 {
147    -1
148}
149
150#[allow(unused)]
151#[allow(clippy::missing_safety_doc)]
152pub unsafe fn compute_sha512_half(
153    _data_ptr: *const u8,
154    _data_len: usize,
155    _out_buff_ptr: *mut u8,
156    _out_buff_len: usize,
157) -> i32 {
158    -1
159}
160
161#[allow(unused)]
162#[allow(clippy::missing_safety_doc)]
163pub unsafe fn check_sig(
164    _message_ptr: *const u8,
165    _message_len: usize,
166    _signature_ptr: *const u8,
167    _signature_len: usize,
168    _pubkey_ptr: *const u8,
169    _pubkey_len: usize,
170) -> i32 {
171    -1
172}
173
174#[allow(unused)]
175#[allow(clippy::missing_safety_doc)]
176pub unsafe fn account_keylet(
177    _account_ptr: *const u8,
178    _account_len: usize,
179    _out_buff_ptr: *mut u8,
180    _out_buff_len: usize,
181) -> i32 {
182    32
183}
184
185#[allow(unused)]
186#[allow(clippy::missing_safety_doc)]
187pub unsafe fn amm_keylet(
188    _issue1_ptr: *const u8,
189    _issue1_len: usize,
190    _issue2_ptr: *const u8,
191    _issue2_len: usize,
192    _out_buff_ptr: *mut u8,
193    _out_buff_len: usize,
194) -> i32 {
195    32
196}
197
198#[allow(unused)]
199#[allow(clippy::missing_safety_doc)]
200pub unsafe fn check_keylet(
201    _account_ptr: *const u8,
202    _account_len: usize,
203    _sequence: i32,
204    _out_buff_ptr: *mut u8,
205    _out_buff_len: usize,
206) -> i32 {
207    32
208}
209
210#[allow(unused)]
211#[allow(clippy::too_many_arguments)]
212#[allow(clippy::missing_safety_doc)]
213pub unsafe fn credential_keylet(
214    _subject_ptr: *const u8,
215    _subject_len: usize,
216    _issuer_ptr: *const u8,
217    _issuer_len: usize,
218    _cred_type_ptr: *const u8,
219    _cred_type_len: usize,
220    _out_buff_ptr: *mut u8,
221    _out_buff_len: usize,
222) -> i32 {
223    32
224}
225
226#[allow(unused)]
227#[allow(clippy::missing_safety_doc)]
228pub unsafe fn delegate_keylet(
229    _account_ptr: *const u8,
230    _account_len: usize,
231    _authorize_ptr: *const u8,
232    _authorize_len: usize,
233    _out_buff_ptr: *mut u8,
234    _out_buff_len: usize,
235) -> i32 {
236    32
237}
238
239#[allow(unused)]
240#[allow(clippy::missing_safety_doc)]
241pub unsafe fn deposit_preauth_keylet(
242    _account_ptr: *const u8,
243    _account_len: usize,
244    _authorize_ptr: *const u8,
245    _authorize_len: usize,
246    _out_buff_ptr: *mut u8,
247    _out_buff_len: usize,
248) -> i32 {
249    32
250}
251
252#[allow(unused)]
253#[allow(clippy::missing_safety_doc)]
254pub unsafe fn did_keylet(
255    _account_ptr: *const u8,
256    _account_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 escrow_keylet(
266    _account_ptr: *const u8,
267    _account_len: usize,
268    _sequence: i32,
269    _out_buff_ptr: *mut u8,
270    _out_buff_len: usize,
271) -> i32 {
272    32
273}
274
275#[allow(unused)]
276#[allow(clippy::too_many_arguments)]
277#[allow(clippy::missing_safety_doc)]
278pub unsafe fn line_keylet(
279    _account1_ptr: *const u8,
280    _account1_len: usize,
281    _account2_ptr: *const u8,
282    _account2_len: usize,
283    _currency_ptr: *const u8,
284    _currency_len: usize,
285    _out_buff_ptr: *mut u8,
286    _out_buff_len: usize,
287) -> i32 {
288    32
289}
290
291#[allow(unused)]
292#[allow(clippy::missing_safety_doc)]
293pub unsafe fn mpt_issuance_keylet(
294    _issuer_ptr: *const u8,
295    _issuer_len: usize,
296    _sequence: i32,
297    _out_buff_ptr: *mut u8,
298    _out_buff_len: usize,
299) -> i32 {
300    32
301}
302
303#[allow(unused)]
304#[allow(clippy::missing_safety_doc)]
305pub unsafe fn mptoken_keylet(
306    _mptid_ptr: *const u8,
307    _mptid_len: usize,
308    _holder_ptr: *const u8,
309    _holder_len: usize,
310    _out_buff_ptr: *mut u8,
311    _out_buff_len: usize,
312) -> i32 {
313    32
314}
315
316#[allow(unused)]
317#[allow(clippy::missing_safety_doc)]
318pub unsafe fn nft_offer_keylet(
319    _account_ptr: *const u8,
320    _account_len: usize,
321    _sequence: i32,
322    _out_buff_ptr: *mut u8,
323    _out_buff_len: usize,
324) -> i32 {
325    32
326}
327
328#[allow(unused)]
329#[allow(clippy::missing_safety_doc)]
330pub unsafe fn offer_keylet(
331    _account_ptr: *const u8,
332    _account_len: usize,
333    _sequence: i32,
334    _out_buff_ptr: *mut u8,
335    _out_buff_len: usize,
336) -> i32 {
337    32
338}
339
340#[allow(unused)]
341#[allow(clippy::missing_safety_doc)]
342pub unsafe fn oracle_keylet(
343    _account_ptr: *const u8,
344    _account_len: usize,
345    _document_id: 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 paychan_keylet(
355    _account_ptr: *const u8,
356    _account_len: usize,
357    _destination_ptr: *const u8,
358    _destination_len: usize,
359    _sequence: i32,
360    _out_buff_ptr: *mut u8,
361    _out_buff_len: usize,
362) -> i32 {
363    32
364}
365
366#[allow(unused)]
367#[allow(clippy::missing_safety_doc)]
368pub unsafe fn permissioned_domain_keylet(
369    _account_ptr: *const u8,
370    _account_len: usize,
371    _sequence: i32,
372    _out_buff_ptr: *mut u8,
373    _out_buff_len: usize,
374) -> i32 {
375    32
376}
377
378#[allow(unused)]
379#[allow(clippy::missing_safety_doc)]
380pub unsafe fn signers_keylet(
381    _account_ptr: *const u8,
382    _account_len: usize,
383    _out_buff_ptr: *mut u8,
384    _out_buff_len: usize,
385) -> i32 {
386    32
387}
388
389#[allow(unused)]
390#[allow(clippy::missing_safety_doc)]
391pub unsafe fn ticket_keylet(
392    _account_ptr: *const u8,
393    _account_len: usize,
394    _sequence: i32,
395    _out_buff_ptr: *mut u8,
396    _out_buff_len: usize,
397) -> i32 {
398    32
399}
400
401#[allow(unused)]
402#[allow(clippy::missing_safety_doc)]
403pub unsafe fn vault_keylet(
404    _account_ptr: *const u8,
405    _account_len: usize,
406    _sequence: i32,
407    _out_buff_ptr: *mut u8,
408    _out_buff_len: usize,
409) -> i32 {
410    32
411}
412
413#[allow(unused)]
414#[allow(clippy::missing_safety_doc)]
415pub unsafe fn get_nft(
416    _account_ptr: *const u8,
417    _account_len: usize,
418    _nft_id_ptr: *const u8,
419    _nft_id_len: usize,
420    _out_buff_ptr: *mut u8,
421    _out_buff_len: usize,
422) -> i32 {
423    -1
424}
425
426#[allow(unused)]
427#[allow(clippy::missing_safety_doc)]
428pub unsafe fn get_nft_issuer(
429    _nft_id_ptr: *const u8,
430    _nft_id_len: usize,
431    _out_buff_ptr: *mut u8,
432    _out_buff_len: usize,
433) -> i32 {
434    -1
435}
436
437#[allow(unused)]
438#[allow(clippy::missing_safety_doc)]
439pub unsafe fn get_nft_taxon(
440    _nft_id_ptr: *const u8,
441    _nft_id_len: usize,
442    _out_buff_ptr: *mut u8,
443    _out_buff_len: usize,
444) -> i32 {
445    -1
446}
447
448#[allow(unused)]
449#[allow(clippy::missing_safety_doc)]
450pub unsafe fn get_nft_flags(_nft_id_ptr: *const u8, _nft_id_len: usize) -> i32 {
451    -1
452}
453
454#[allow(unused)]
455#[allow(clippy::missing_safety_doc)]
456pub unsafe fn get_nft_transfer_fee(_nft_id_ptr: *const u8, _nft_id_len: usize) -> i32 {
457    -1
458}
459
460#[allow(unused)]
461#[allow(clippy::missing_safety_doc)]
462pub unsafe fn get_nft_serial(
463    _nft_id_ptr: *const u8,
464    _nft_id_len: usize,
465    _out_buff_ptr: *mut u8,
466    _out_buff_len: usize,
467) -> i32 {
468    -1
469}
470
471#[allow(unused)]
472#[allow(clippy::missing_safety_doc)]
473pub unsafe fn float_from_int(
474    _in_int: i64,
475    _out_buff: *mut u8,
476    _out_buff_len: usize,
477    _rounding_mode: i32,
478) -> i32 {
479    -1
480}
481
482#[allow(unused)]
483#[allow(clippy::missing_safety_doc)]
484pub unsafe fn float_from_uint(
485    _in_uint_ptr: *const u8,
486    _in_uint_len: usize,
487    _out_buff: *mut u8,
488    _out_buff_len: usize,
489    _rounding_mode: i32,
490) -> i32 {
491    -1
492}
493
494#[allow(unused)]
495#[allow(clippy::missing_safety_doc)]
496pub unsafe fn float_set(
497    _exponent: i32,
498    _mantissa: i64,
499    _out_buff: *mut u8,
500    _out_buff_len: usize,
501    _rounding_mode: i32,
502) -> i32 {
503    -1
504}
505
506#[allow(unused)]
507#[allow(clippy::missing_safety_doc)]
508pub unsafe fn float_compare(
509    _in_buff1: *const u8,
510    _in_buff1_len: usize,
511    _in_buff2: *const u8,
512    _in_buff2_len: usize,
513) -> i32 {
514    -1
515}
516
517#[allow(unused)]
518#[allow(clippy::missing_safety_doc)]
519pub unsafe fn float_add(
520    _in_buff1: *const u8,
521    _in_buff1_len: usize,
522    _in_buff2: *const u8,
523    _in_buff2_len: usize,
524    _out_buff: *mut u8,
525    _out_buff_len: usize,
526    _rounding_mode: i32,
527) -> i32 {
528    -1
529}
530
531#[allow(unused)]
532#[allow(clippy::missing_safety_doc)]
533pub unsafe fn float_subtract(
534    _in_buff1: *const u8,
535    _in_buff1_len: usize,
536    _in_buff2: *const u8,
537    _in_buff2_len: usize,
538    _out_buff: *mut u8,
539    _out_buff_len: usize,
540    _rounding_mode: i32,
541) -> i32 {
542    -1
543}
544
545#[allow(unused)]
546#[allow(clippy::missing_safety_doc)]
547pub unsafe fn float_multiply(
548    _in_buff1: *const u8,
549    _in_buff1_len: usize,
550    _in_buff2: *const u8,
551    _in_buff2_len: usize,
552    _out_buff: *mut u8,
553    _out_buff_len: usize,
554    _rounding_mode: i32,
555) -> i32 {
556    -1
557}
558
559#[allow(unused)]
560#[allow(clippy::missing_safety_doc)]
561pub unsafe fn float_divide(
562    _in_buff1: *const u8,
563    _in_buff1_len: usize,
564    _in_buff2: *const u8,
565    _in_buff2_len: usize,
566    _out_buff: *mut u8,
567    _out_buff_len: usize,
568    _rounding_mode: i32,
569) -> i32 {
570    -1
571}
572
573#[allow(unused)]
574#[allow(clippy::missing_safety_doc)]
575pub unsafe fn float_pow(
576    _in_buff: *const u8,
577    _in_buff_len: usize,
578    _in_int: i32,
579    _out_buff: *mut u8,
580    _out_buff_len: usize,
581    _rounding_mode: i32,
582) -> i32 {
583    -1
584}
585
586#[allow(unused)]
587#[allow(clippy::missing_safety_doc)]
588pub unsafe fn float_root(
589    _in_buff: *const u8,
590    _in_buff_len: usize,
591    _in_int: i32,
592    _out_buff: *mut u8,
593    _out_buff_len: usize,
594    _rounding_mode: i32,
595) -> i32 {
596    -1
597}
598
599#[allow(unused)]
600#[allow(clippy::missing_safety_doc)]
601pub unsafe fn float_log(
602    _in_buff: *const u8,
603    _in_buff_len: usize,
604    _out_buff: *mut u8,
605    _out_buff_len: usize,
606    _rounding_mode: i32,
607) -> i32 {
608    -1
609}
610
611#[allow(unused)]
612#[allow(clippy::missing_safety_doc)]
613pub unsafe fn trace(
614    _msg_read_ptr: *const u8,
615    _msg_read_len: usize,
616    _data_read_ptr: *const u8,
617    _data_read_len: usize,
618    _as_hex: i32,
619) -> i32 {
620    -1
621}
622
623#[allow(unused)]
624#[allow(clippy::missing_safety_doc)]
625pub unsafe fn trace_num(_msg_read_ptr: *const u8, _msg_read_len: usize, _number: i64) -> i32 {
626    -1
627}
628
629#[allow(unused)]
630#[allow(clippy::missing_safety_doc)]
631pub unsafe fn trace_account(
632    _msg_read_ptr: *const u8,
633    _msg_read_len: usize,
634    _account_ptr: *const u8,
635    _account_len: usize,
636) -> i32 {
637    -1
638}
639
640#[allow(unused)]
641#[allow(clippy::missing_safety_doc)]
642pub unsafe fn trace_opaque_float(
643    _msg_read_ptr: *const u8,
644    _msg_read_len: usize,
645    _opaque_float_ptr: *const u8,
646    _opaque_float_len: usize,
647) -> i32 {
648    -1
649}
650
651#[allow(unused)]
652#[allow(clippy::missing_safety_doc)]
653pub unsafe fn trace_amount(
654    _msg_read_ptr: *const u8,
655    _msg_read_len: usize,
656    _amount_ptr: *const u8,
657    _amount_len: usize,
658) -> i32 {
659    0 // Success for testing
660}