Skip to content

Commit

Permalink
Bump env XDR
Browse files Browse the repository at this point in the history
  • Loading branch information
dmkozh authored and graydon committed Oct 11, 2023
1 parent 6e0e084 commit 853c61b
Show file tree
Hide file tree
Showing 29 changed files with 28 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ soroban-native-sdk-macros = { version = "20.0.0-rc2", path = "soroban-native-sdk
[workspace.dependencies.stellar-xdr]
version = "20.0.0-rc1"
git = "https://github.com/stellar/rs-stellar-xdr"
rev = "c9d24eb4fae1f9968f6620e06750c1fce7a5d6c3"
rev = "18b1ef752f6262769be5afe69a3e45aca48632f9"
default-features = false

[workspace.dependencies.wasmi]
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-common/src/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ soroban_env_macros::generate_env_meta_consts!(
#[cfg(not(feature = "next"))]
soroban_env_macros::generate_env_meta_consts!(
ledger_protocol_version: 20,
pre_release_version: 65,
pre_release_version: 66,
);

pub const fn get_ledger_protocol_version(interface_version: u64) -> u32 {
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ fn display_scval(scv: &ScVal, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Resu
write!(f, "ContractInstance(Wasm({}))", hash)
}
ScVal::ContractInstance(ScContractInstance {
executable: ContractExecutable::Token,
executable: ContractExecutable::StellarAsset,
..
}) => write!(f, "ContractInstance(Token)"),
}
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1781,7 +1781,7 @@ impl VmCallerEnv for Host {
) -> Result<AddressObject, HostError> {
let asset: Asset = self.metered_from_xdr_obj(serialized_asset)?;
let contract_id_preimage = ContractIdPreimage::Asset(asset);
let executable = ContractExecutable::Token;
let executable = ContractExecutable::StellarAsset;
let args = CreateContractArgs {
contract_id_preimage,
executable,
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/host/data_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl Host {
)
.map_err(|e| self.decorate_contract_code_storage_error(e, &wasm_hash))?;
}
ContractExecutable::Token => {}
ContractExecutable::StellarAsset => {}
}
Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/host/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl Host {
|| vm.invoke_function_raw(self, func, args),
)
}
ContractExecutable::Token => self.with_frame(
ContractExecutable::StellarAsset => self.with_frame(
Frame::Token(id.metered_clone(self)?, *func, args_vec, instance),
|| {
use crate::native_contract::{NativeContract, Token};
Expand Down
2 changes: 1 addition & 1 deletion soroban-env-host/src/native_contract/account_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl AuthorizationContext {
xdr::ContractExecutable::Wasm(wasm_hash) => {
BytesN::<32>::from_slice(host, wasm_hash.as_slice())?
}
xdr::ContractExecutable::Token => return Err(host.err(
xdr::ContractExecutable::StellarAsset => return Err(host.err(
ScErrorType::Auth,
ScErrorCode::InvalidInput,
"token executable is not allowed when authorizing create_contract host fn",
Expand Down
4 changes: 2 additions & 2 deletions soroban-env-host/src/native_contract/common_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::base_types::BytesN;
#[contracttype]
pub enum ContractExecutable {
Wasm(BytesN<32>),
Token,
StellarAsset,
}

impl ContractExecutable {
Expand All @@ -17,7 +17,7 @@ impl ContractExecutable {
xdr::ContractExecutable::Wasm(wasm_hash) => Ok(ContractExecutable::Wasm(
BytesN::<32>::from_slice(host, &wasm_hash.0)?,
)),
xdr::ContractExecutable::Token => Ok(ContractExecutable::Token),
xdr::ContractExecutable::StellarAsset => Ok(ContractExecutable::StellarAsset),
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl InvokerContractAuthEntry {
ContractExecutable::Wasm(b) => {
host.hash_from_bytesobj_input("wasm_ref", b.as_object())?
}
ContractExecutable::Token => {
ContractExecutable::StellarAsset => {
return Err(host.err(
ScErrorType::Auth,
ScErrorCode::InternalError,
Expand Down
23 changes: 17 additions & 6 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.

Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_add_f32.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_add_i32.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_alloc.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_complex.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_err.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_fannkuch.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_fib.wasm
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_hostile.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified soroban-test-wasms/wasm-workspace/opt/curr/example_vec.wasm
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 853c61b

Please sign in to comment.