moverox-build 0.2.6

Build script utilities to oxidize an entire Move package
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
---
source: crates/moverox-build/src/tests.rs
expression: move_stdlib
---
#[cfg_attr(
    not(doctest),
    doc = " The `ASCII` module defines basic string and char newtypes in Move that verify"
)]
#[cfg_attr(
    not(doctest),
    doc = " that characters are valid ASCII, and that strings consist of only valid ASCII characters."
)]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod ascii {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(
        not(doctest),
        doc = " The `String` struct holds a vector of bytes that all represent"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " valid ASCII characters. Note that these ASCII characters may not all"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " be printable. To determine if a `String` contains only \"printable\""
    )]
    #[cfg_attr(
        not(doctest),
        doc = " characters you should use the `all_characters_printable` predicate"
    )]
    #[cfg_attr(not(doctest), doc = " defined in this module.")]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = ascii)]
    #[allow(non_snake_case)]
    pub struct String {
        pub bytes: vector<u8>,
    }
    impl String {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(bytes: vector<u8>) -> Self {
            Self { bytes }
        }
    }
    #[cfg_attr(not(doctest), doc = " An ASCII character.")]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = ascii)]
    #[allow(non_snake_case)]
    pub struct Char {
        pub byte: u8,
    }
    impl Char {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(byte: u8) -> Self {
            Self { byte }
        }
    }
}
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod bit_vector {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = bit_vector)]
    #[allow(non_snake_case)]
    pub struct BitVector {
        pub length: u64,
        pub bit_field: vector<bool>,
    }
    impl BitVector {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(length: u64, bit_field: vector<bool>) -> Self {
            Self { length, bit_field }
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " Defines a fixed-point numeric type with a 32-bit integer part and"
)]
#[cfg_attr(not(doctest), doc = " a 32-bit fractional part.")]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod fixed_point32 {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(
        not(doctest),
        doc = " Define a fixed-point numeric type with 32 fractional bits."
    )]
    #[cfg_attr(
        not(doctest),
        doc = " This is just a u64 integer but it is wrapped in a struct to"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " make a unique type. This is a binary representation, so decimal"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " values may not be exactly representable, but it provides more"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " than 9 decimal digits of precision both before and after the"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " decimal point (18 digits total). For comparison, double precision"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " floating-point has less than 16 decimal digits of precision, so"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " be careful about using floating-point to convert these values to"
    )]
    #[cfg_attr(not(doctest), doc = " decimal.")]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = fixed_point32)]
    #[allow(non_snake_case)]
    pub struct FixedPoint32 {
        pub value: u64,
    }
    impl FixedPoint32 {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(value: u64) -> Self {
            Self { value }
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " Defines the `Permit` type, which can be used to constrain the logic of a"
)]
#[cfg_attr(
    not(doctest),
    doc = " generic function to be authorized only by the module that defines the type"
)]
#[cfg_attr(not(doctest), doc = " parameter.")]
#[cfg_attr(not(doctest), doc = "")]
#[cfg_attr(not(doctest), doc = " ```move")]
#[cfg_attr(not(doctest), doc = " module example::use_permit;")]
#[cfg_attr(not(doctest), doc = "")]
#[cfg_attr(not(doctest), doc = " public struct MyType { /* ... */ }")]
#[cfg_attr(not(doctest), doc = "")]
#[cfg_attr(not(doctest), doc = " public fun test_permit() {")]
#[cfg_attr(not(doctest), doc = "    let permit = internal::permit<MyType>();")]
#[cfg_attr(not(doctest), doc = "    /* external_module::call_with_permit(permit); */")]
#[cfg_attr(not(doctest), doc = " }")]
#[cfg_attr(not(doctest), doc = " ```")]
#[cfg_attr(not(doctest), doc = "")]
#[cfg_attr(
    not(doctest),
    doc = " To write a function that is guarded by a `Permit`, require it as an argument."
)]
#[cfg_attr(not(doctest), doc = "")]
#[cfg_attr(not(doctest), doc = " ```move")]
#[cfg_attr(
    not(doctest),
    doc = " // Silly mockup of a type registry where a type can be registered only by"
)]
#[cfg_attr(not(doctest), doc = " // the module that defines the type.")]
#[cfg_attr(not(doctest), doc = " module example::type_registry;")]
#[cfg_attr(not(doctest), doc = "")]
#[cfg_attr(
    not(doctest),
    doc = " public fun register_type<T>(_: internal::Permit<T> /* ... */) {"
)]
#[cfg_attr(not(doctest), doc = "   /* ... */")]
#[cfg_attr(not(doctest), doc = " }")]
#[cfg_attr(not(doctest), doc = " ```")]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod internal {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(not(doctest), doc = " A privileged witness of the `T` type.")]
    #[cfg_attr(
        not(doctest),
        doc = " Instances can only be created by the module that defines the type `T`."
    )]
    #[derive(
        Default,
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = internal)]
    #[allow(non_snake_case)]
    pub struct Permit<T>(bool, #[serde(skip)] ::std::marker::PhantomData<T>);
    impl<T> Permit<T> {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new() -> Self {
            Self(false, ::std::marker::PhantomData)
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " This module defines the Option type and its methods to represent and handle an optional value."
)]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod option {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(
        not(doctest),
        doc = " Abstraction of a value that may or may not be present. Implemented with a vector of size"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " zero or one because Move bytecode does not have ADTs."
    )]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = option)]
    #[allow(non_snake_case)]
    pub struct Option<Element> {
        pub vec: vector<Element>,
    }
    impl<Element> Option<Element> {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(vec: vector<Element>) -> Self {
            Self { vec }
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " The `string` module defines the `String` type which represents UTF8 encoded"
)]
#[cfg_attr(not(doctest), doc = " strings.")]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod string {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(
        not(doctest),
        doc = " A `String` holds a sequence of bytes which is guaranteed to be in utf8"
    )]
    #[cfg_attr(not(doctest), doc = " format.")]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = string)]
    #[allow(non_snake_case)]
    pub struct String {
        pub bytes: vector<u8>,
    }
    impl String {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(bytes: vector<u8>) -> Self {
            Self { bytes }
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " Functionality for converting Move types into values. Use with care!"
)]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod type_name {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = type_name)]
    #[allow(non_snake_case)]
    pub struct TypeName {
        /// String representation of the type. All types are represented
        /// using their source syntax:
        /// "u8", "u64", "bool", "address", "vector", and so on for primitive types.
        /// Struct types are represented as fully qualified type names; e.g.
        /// `00000000000000000000000000000001::string::String` or
        /// `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
        /// Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or 32 depending on the Move platform)
        pub name: super::ascii::String,
    }
    impl TypeName {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(name: super::ascii::String) -> Self {
            Self { name }
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " Defines an unsigned, fixed-point numeric type with a 32-bit integer part and a 32-bit fractional"
)]
#[cfg_attr(
    not(doctest),
    doc = " part. The notation `uq32_32` and `UQ32_32` is based on"
)]
#[cfg_attr(
    not(doctest),
    doc = " [Q notation](https://en.wikipedia.org/wiki/Q_(number_format)). `q` indicates it a fixed-point"
)]
#[cfg_attr(
    not(doctest),
    doc = " number. The `u` prefix indicates it is unsigned. The `32_32` suffix indicates the number of"
)]
#[cfg_attr(
    not(doctest),
    doc = " bits, where the first number indicates the number of bits in the integer part, and the second"
)]
#[cfg_attr(
    not(doctest),
    doc = " the number of bits in the fractional part--in this case 32 bits for each."
)]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod uq32_32 {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(
        not(doctest),
        doc = " A fixed-point numeric type with 32 integer bits and 32 fractional bits, represented by an"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " underlying 64 bit value. This is a binary representation, so decimal values may not be exactly"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " representable, but it provides more than 9 decimal digits of precision both before and after the"
    )]
    #[cfg_attr(not(doctest), doc = " decimal point (18 digits total).")]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = uq32_32)]
    #[allow(non_snake_case)]
    pub struct UQ32_32(pub u64);
    impl UQ32_32 {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(_0: u64) -> Self {
            Self(_0)
        }
    }
}
#[cfg_attr(
    not(doctest),
    doc = " Defines an unsigned, fixed-point numeric type with a 64-bit integer part and a 64-bit fractional"
)]
#[cfg_attr(
    not(doctest),
    doc = " part. The notation `uq64_64` and `UQ64_64` is based on"
)]
#[cfg_attr(
    not(doctest),
    doc = " [Q notation](https://en.wikipedia.org/wiki/Q_(number_format)). `q` indicates it a fixed-point"
)]
#[cfg_attr(
    not(doctest),
    doc = " number. The `u` prefix indicates it is unsigned. The `64_64` suffix indicates the number of"
)]
#[cfg_attr(
    not(doctest),
    doc = " bits, where the first number indicates the number of bits in the integer part, and the second"
)]
#[cfg_attr(
    not(doctest),
    doc = " the number of bits in the fractional part--in this case 64 bits for each."
)]
#[allow(rustdoc::all, clippy::too_long_first_doc_paragraph)]
pub mod uq64_64 {
    #[allow(non_camel_case_types, unused)]
    type address = ::moverox::types::Address;
    #[allow(non_camel_case_types, unused)]
    type u256 = ::moverox::types::U256;
    #[allow(non_camel_case_types, unused)]
    type vector<T> = ::std::vec::Vec<T>;
    #[cfg_attr(
        not(doctest),
        doc = " A fixed-point numeric type with 64 integer bits and 64 fractional bits, represented by an"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " underlying 128 bit value. This is a binary representation, so decimal values may not be exactly"
    )]
    #[cfg_attr(
        not(doctest),
        doc = " representable, but it provides more than 19 decimal digits of precision both before and after"
    )]
    #[cfg_attr(not(doctest), doc = " the decimal point (38 digits total).")]
    #[derive(
        Clone,
        Debug,
        PartialEq,
        Eq,
        Hash,
        ::moverox::traits::MoveDatatype,
        ::moverox::serde::Deserialize,
        ::moverox::serde::Serialize,
    )]
    #[move_(crate = ::moverox::traits)]
    #[serde(crate = "::moverox::serde")]
    #[move_(address = "0x1")]
    #[move_(module = uq64_64)]
    #[allow(non_snake_case)]
    pub struct UQ64_64(pub u128);
    impl UQ64_64 {
        #[allow(clippy::just_underscores_and_digits, clippy::too_many_arguments)]
        pub const fn new(_0: u128) -> Self {
            Self(_0)
        }
    }
}