Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions Cargo.lock

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

4 changes: 1 addition & 3 deletions binary_port/src/error_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ pub enum ErrorCode {
#[error("Transaction attempts to set a delegation amount above the highest allowed value")]
InvalidDelegationAmount = 116,
#[error("the transaction invocation target is unsupported under V2 runtime")]
// This code is not used, but we had a production release with it so we can't reuse it
UnsupportedInvocationTarget = 117,
}

Expand Down Expand Up @@ -568,9 +569,6 @@ impl From<InvalidTransactionV1> for ErrorCode {
InvalidTransactionV1::InvalidDelegationAmount { .. } => {
ErrorCode::InvalidDelegationAmount
}
InvalidTransactionV1::UnsupportedInvocationTarget { .. } => {
ErrorCode::UnsupportedInvocationTarget
}
InvalidTransactionV1::MissingSeed => ErrorCode::InvalidTransactionMissingSeed,
_other => ErrorCode::InvalidTransactionUnspecified,
}
Expand Down
317 changes: 260 additions & 57 deletions executor/wasm/src/lib.rs

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions executor/wasm/tests/altbn128.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ use casper_executor_wasm::testing::{
};

use casper_executor_wasm::{chainspec_config, chainspec_config::ChainspecConfig};
use casper_executor_wasm_interface::executor::{ExecuteWithProviderError, ExecutionKind};
use casper_executor_wasm_interface::executor::{
ExecuteWithProviderError, ExecutionKind, PackagePointer,
};
use casper_storage::global_state::state::CommitProvider;
use once_cell::sync::Lazy;

Expand Down Expand Up @@ -174,8 +176,10 @@ fn run_pairing_endpoint_test<T: BorshSerialize>(
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "pairing".to_owned(),
version: None,
protocol_version_major: None,
})
.with_serialized_input(input)
.expect("expected serialized input to be correct")
Expand Down
10 changes: 7 additions & 3 deletions executor/wasm/tests/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use casper_executor_wasm::{
};

use casper_executor_wasm::{chainspec_config, chainspec_config::ChainspecConfig};
use casper_executor_wasm_interface::executor::ExecutionKind;
use casper_executor_wasm_interface::executor::{ExecutionKind, PackagePointer};
use casper_storage::global_state::state::CommitProvider;
use once_cell::sync::Lazy;

Expand Down Expand Up @@ -77,8 +77,10 @@ fn should_run_test_suite() {
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "assertions".to_owned(),
version: None,
protocol_version_major: None,
})
.build()
.expect("should build");
Expand Down Expand Up @@ -145,8 +147,10 @@ fn inserting_into_non_existing_vec_index_fails() {
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "test_remove_invalid_index_prepare".to_owned(),
version: None,
protocol_version_major: None,
})
.build()
.expect("should build");
Expand Down
20 changes: 14 additions & 6 deletions executor/wasm/tests/hello_world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ use casper_executor_wasm::{
ExecutorV2,
};
use casper_executor_wasm_interface::{
executor::ExecutionKind,
install::{InstallContractResult, InstallContractWithProviderResult},
executor::{ExecutionKind, PackagePointer},
install::InstallContractWithProviderResult,
};
use casper_storage::{
data_access_layer::{QueryRequest, QueryResult},
Expand Down Expand Up @@ -95,8 +95,10 @@ fn should_store_state_after_changes() {
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "spanish".to_owned(),
version: None,
protocol_version_major: None,
})
.build()
.expect("should build");
Expand All @@ -115,8 +117,10 @@ fn should_store_state_after_changes() {
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "french".to_owned(),
version: None,
protocol_version_major: None,
})
.build()
.expect("should build");
Expand Down Expand Up @@ -176,8 +180,10 @@ fn should_fetch_data_with_contract_method() {
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "spanish".to_owned(),
version: None,
protocol_version_major: None,
})
.build()
.expect("should build");
Expand All @@ -196,8 +202,10 @@ fn should_fetch_data_with_contract_method() {
.with_shared_address_generator(Arc::clone(&address_generator))
.with_transferred_value(0)
.with_execution_kind(ExecutionKind::Stored {
address: contract_address,
package_pointer: PackagePointer::HashAddr(contract_address),
entry_point: "get".to_owned(),
version: None,
protocol_version_major: None,
})
.build()
.expect("should build");
Expand Down
Loading