-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathtest_macros_wasm32v1-none.rs
More file actions
106 lines (106 loc) · 3.18 KB
/
test_macros_wasm32v1-none.rs
File metadata and controls
106 lines (106 loc) · 3.18 KB
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
#![feature(prelude_import)]
#![no_std]
#[macro_use]
extern crate core;
#[prelude_import]
use core::prelude::rust_2021::*;
use proc_macros::{parse_item_fn, parse_item_impl};
use soroban_sdk::{contract, contractimpl};
pub struct Contract;
///ContractArgs is a type for building arg lists for functions defined in "Contract".
pub struct ContractArgs;
///ContractClient is a client for calling the contract defined in "Contract".
pub struct ContractClient<'a> {
pub env: soroban_sdk::Env,
pub address: soroban_sdk::Address,
#[doc(hidden)]
_phantom: core::marker::PhantomData<&'a ()>,
}
impl<'a> ContractClient<'a> {
pub fn new(env: &soroban_sdk::Env, address: &soroban_sdk::Address) -> Self {
Self {
env: env.clone(),
address: address.clone(),
_phantom: core::marker::PhantomData,
}
}
}
impl Contract {
pub fn empty() {}
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub mod __Contract__empty__spec {
#[doc(hidden)]
#[allow(non_snake_case)]
#[allow(non_upper_case_globals)]
#[link_section = "contractspecv0"]
pub static __SPEC_XDR_FN_EMPTY: [u8; 28usize] = super::Contract::spec_xdr_empty();
}
impl Contract {
#[allow(non_snake_case)]
pub const fn spec_xdr_empty() -> [u8; 28usize] {
*b"\0\0\0\0\0\0\0\0\0\0\0\x05empty\0\0\0\0\0\0\0\0\0\0\0"
}
}
impl<'a> ContractClient<'a> {
pub fn empty(&self) -> () {
use core::ops::Not;
use soroban_sdk::{FromVal, IntoVal};
let res = self.env.invoke_contract(
&self.address,
&{
#[allow(deprecated)]
const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("empty");
SYMBOL
},
::soroban_sdk::Vec::new(&self.env),
);
res
}
pub fn try_empty(
&self,
) -> Result<
Result<(), <() as soroban_sdk::TryFromVal<soroban_sdk::Env, soroban_sdk::Val>>::Error>,
Result<soroban_sdk::Error, soroban_sdk::InvokeError>,
> {
use soroban_sdk::{FromVal, IntoVal};
let res = self.env.try_invoke_contract(
&self.address,
&{
#[allow(deprecated)]
const SYMBOL: soroban_sdk::Symbol = soroban_sdk::Symbol::short("empty");
SYMBOL
},
::soroban_sdk::Vec::new(&self.env),
);
res
}
}
impl ContractArgs {
#[inline(always)]
#[allow(clippy::unused_unit)]
pub fn empty<'i>() -> () {
()
}
}
#[doc(hidden)]
#[allow(non_snake_case)]
pub mod __Contract__empty {
use super::*;
#[deprecated(note = "use `ContractClient::new(&env, &contract_id).empty` instead")]
pub fn invoke_raw(env: soroban_sdk::Env) -> soroban_sdk::Val {
<_ as soroban_sdk::IntoVal<soroban_sdk::Env, soroban_sdk::Val>>::into_val(
#[allow(deprecated)]
&<super::Contract>::empty(),
&env,
)
}
#[deprecated(note = "use `ContractClient::new(&env, &contract_id).empty` instead")]
#[export_name = "empty"]
pub extern "C" fn invoke_raw_extern() -> soroban_sdk::Val {
#[allow(deprecated)]
invoke_raw(soroban_sdk::Env::default())
}
use super::*;
}