Skip to content

Commit

Permalink
regenerate wasms
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Jun 24, 2023
1 parent d34eaf1 commit 5af91b2
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 31 deletions.
38 changes: 22 additions & 16 deletions soroban-test-wasms/wasm-workspace/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions soroban-test-wasms/wasm-workspace/add_f32/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![no_std]
use soroban_sdk::{contract, contractimpl, Env, Symbol};
use soroban_sdk::{contract, contractimpl, Env, symbol_short};

#[contract]
pub struct Contract;

#[contractimpl]
impl Contract {
pub fn add(env: Env, a: i32, b: i32) -> i32 {
env.events().publish((Symbol::short("add"),), (a, b));
env.events().publish((symbol_short!("add"),), (a, b));
let a = a as f32;
let b = b as f32;
(a + b) as i32
Expand Down
4 changes: 2 additions & 2 deletions soroban-test-wasms/wasm-workspace/add_i32/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![no_std]
use soroban_sdk::{contract, contractimpl, Env, Symbol};
use soroban_sdk::{contract, contractimpl, Env, symbol_short};

#[contract]
pub struct Contract;

#[contractimpl]
impl Contract {
pub fn add(env: Env, a: i32, b: i32) -> i32 {
env.events().publish((Symbol::short("add"),), (a, b));
env.events().publish((symbol_short!("add"),), (a, b));
a + b
}
}
10 changes: 5 additions & 5 deletions soroban-test-wasms/wasm-workspace/auth/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![no_std]
use soroban_sdk::{
auth::{ContractContext, InvokerContractAuthEntry, SubContractInvocation},
contract, contractimpl, contracttype, vec, Address, Env, IntoVal, Symbol, Vec,
contract, contractimpl, contracttype, vec, Address, Env, IntoVal, symbol_short, Vec,
};

#[contract]
Expand Down Expand Up @@ -31,7 +31,7 @@ impl AuthContract {
for child in tree.children.iter() {
env.invoke_contract::<()>(
&child.contract.clone(),
&Symbol::short("tree_fn"),
&symbol_short!("tree_fn"),
(addresses.clone(), child).into_val(&env),
);
}
Expand All @@ -40,7 +40,7 @@ impl AuthContract {
pub fn order_fn(env: Env, addr: Address, child_id: Address) {
env.invoke_contract::<()>(
&child_id,
&Symbol::short("do_auth"),
&symbol_short!("do_auth"),
(&addr, 10_u32).into_val(&env),
);
addr.require_auth();
Expand All @@ -61,7 +61,7 @@ impl AuthContract {
let curr_address = env.current_contract_address();
env.invoke_contract::<()>(
&tree.contract,
&Symbol::short("tree_fn"),
&symbol_short!("tree_fn"),
(vec![&env, curr_address], tree.clone()).into_val(&env),
);
}
Expand All @@ -77,7 +77,7 @@ fn tree_to_invoker_contract_auth(env: &Env, tree: &TreeNode) -> InvokerContractA
InvokerContractAuthEntry::Contract(SubContractInvocation {
context: ContractContext {
contract: tree.contract.clone(),
fn_name: Symbol::short("tree_fn"),
fn_name: symbol_short!("tree_fn"),
args: vec![&env],
},
sub_invocations,
Expand Down
4 changes: 2 additions & 2 deletions soroban-test-wasms/wasm-workspace/complex/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![no_std]
use soroban_sdk::{contract, contractimpl, contracttype, Bytes, BytesN, Env, Symbol, Vec};
use soroban_sdk::{contract, contractimpl, contracttype, Bytes, BytesN, Env, symbol_short, Vec};

// This is a "complex" contract that uses a nontrivial amount of the host
// interface from the guest: UDTs (thus maps), vectors, byte arrays and linear
Expand Down Expand Up @@ -32,7 +32,7 @@ impl Contract {
seq: ledger.sequence(),
time: ledger.timestamp(),
};
let data = Symbol::short("data");
let data = symbol_short!("data");
let hash = e.crypto().sha256(&my_ledger.network_id.clone().into());
let mut buf: [u8; 32] = [0; 32];
hash.copy_into_slice(&mut buf);
Expand Down
8 changes: 4 additions & 4 deletions soroban-test-wasms/wasm-workspace/invoke_contract/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#![no_std]
use soroban_sdk::{contract, contractimpl, vec, Address, Env, IntoVal, Symbol};
use soroban_sdk::{contract, contractimpl, vec, Address, Env, IntoVal, symbol_short};

#[contract]
pub struct Contract;

#[contractimpl]
impl Contract {
pub fn add(env: Env, a: i32, b: i32) -> i32 {
env.events().publish((Symbol::short("add"),), (a, b));
env.events().publish((symbol_short!("add"),), (a, b));
a + b
}

pub fn add_with(env: Env, x: i32, y: i32, contract_id: Address) -> i32 {
env.events()
.publish((Symbol::short("add_with"),), (x, y, contract_id.clone()));
.publish((symbol_short!("add_with"),), (x, y, contract_id.clone()));
env.invoke_contract(
&contract_id,
&Symbol::short("add"),
&symbol_short!("add"),
vec![&env, x.into_val(&env), y.into_val(&env)],
)
}
Expand Down
Binary file modified soroban-test-wasms/wasm-workspace/opt/auth_test_contract.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_add_f32.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_add_i32.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_complex.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_contract_data.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_create_contract.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_fannkuch.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_fib.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_hostile.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_invoke_contract.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_linear_memory.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_simple_account.wasm
Binary file not shown.
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/example_vec.wasm
Binary file not shown.

0 comments on commit 5af91b2

Please sign in to comment.