Skip to content

Commit

Permalink
Isolate wallet-contract from workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
staffik committed Dec 7, 2023
1 parent 17a7072 commit 1614346
Show file tree
Hide file tree
Showing 12 changed files with 1,707 additions and 608 deletions.
709 changes: 127 additions & 582 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ members = [
"runtime/near-vm-runner",
"runtime/near-vm-runner/fuzz",
"runtime/near-wallet-contract",
"runtime/near-wallet-contract/wallet-contract",
"runtime/runtime",
"runtime/runtime-params-estimator",
"runtime/runtime-params-estimator/estimator-warehouse",
Expand Down Expand Up @@ -229,7 +228,6 @@ near-primitives-core = { path = "core/primitives-core" }
near-rosetta-rpc = { path = "chain/rosetta-rpc" }
near-rpc-error-core = { path = "tools/rpctypegen/core" }
near-rpc-error-macro = { path = "tools/rpctypegen/macro" }
near-sdk = "4.1.1"
near-stable-hasher = { path = "utils/near-stable-hasher" }
near-state-parts = { path = "tools/state-parts" }
near-state-parts-dump-check = { path = "tools/state-parts-dump-check" }
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ nightly = [
"near-telemetry/nightly",
"near-undo-block/nightly",
"near-vm-runner/nightly",
"near-wallet-contract/nightly",
"nearcore/nightly",
"node-runtime/nightly",
"testlib/nightly",
Expand All @@ -132,6 +133,7 @@ nightly_protocol = [
"near-telemetry/nightly_protocol",
"near-undo-block/nightly_protocol",
"near-vm-runner/nightly_protocol",
"near-wallet-contract/nightly_protocol",
"nearcore/nightly_protocol",
"node-runtime/nightly_protocol",
"testlib/nightly_protocol",
Expand Down
11 changes: 7 additions & 4 deletions integration-tests/src/tests/client/features/delegate_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ fn meta_tx_create_eth_implicit_account() {
/// the transaction is either authorized or unauthorized.
/// The parameter `authorized` controls which case will be tested.
fn meta_tx_call_wallet_contract(authorized: bool) {
if !checked_feature!("stable", EthImplicitAccounts, PROTOCOL_VERSION) {
return;
}
let genesis = Genesis::test(vec![alice_account(), bob_account(), carol_account()], 3);
let relayer = alice_account();
let node = RuntimeNode::new_from_genesis(&relayer, genesis);
Expand All @@ -970,18 +973,18 @@ fn meta_tx_call_wallet_contract(authorized: bool) {
let other_public_key = SecretKey::from_seed(KeyType::SECP256K1, "test2").public_key();

// Although ETH-implicit account can be zero-balance, we pick 1 here in order to make transfer later from this account.
let initial_amount = 1u128;
let actions = vec![Action::Transfer(TransferAction { deposit: initial_amount })];
let transfer_amount = 1u128;
let actions = vec![Action::Transfer(TransferAction { deposit: transfer_amount })];
// Create ETH-implicit account by funding it.
node.user()
.meta_tx(sender.clone(), eth_implicit_account.clone(), relayer.clone(), actions)
.unwrap()
.assert_success();

let target = carol_account();
let transfer_amount = 1u128;
let initial_balance = node.view_balance(&target).expect("failed looking up balance");

// TODO(eth-implicit) When `Wallet Contract` is complete, append appropriate values to the RLP stream.
// TODO(eth-implicit) Append appropriate values to the RLP stream when proper `Wallet Contract` is implemented.
let mut stream = RlpStream::new_list(3);
stream.append(&target.as_str());
// The RLP trait `Encodable` is not implemented for `u128`. We must encode it as bytes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<<<<<<< HEAD
=======
#[cfg(not(test))]
extern crate proc_macro;
>>>>>>> 27e96cad2 (compiler-test-derive: Switch to proc_macro exclusively)
use proc_macro::TokenStream;
use quote::quote;
use std::path::PathBuf;
Expand Down
10 changes: 8 additions & 2 deletions runtime/near-wallet-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version.workspace = true
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
description = "Builds and exposes a temporary Wallet Contract wasm file."
description = "Builds and exposes Wallet Contract code."
repository.workspace = true
license.workspace = true
publish = false
Expand All @@ -20,4 +20,10 @@ wasm-encoder.workspace = true
wasm-smith.workspace = true

[features]
nightly = []
nightly_protocol = [
"near-vm-runner/nightly_protocol",
]
nightly = [
"nightly_protocol",
"near-vm-runner/nightly",
]
Binary file modified runtime/near-wallet-contract/res/nightly_wallet_contract.wasm
Binary file not shown.
Binary file modified runtime/near-wallet-contract/res/wallet_contract.wasm
Binary file not shown.
Loading

0 comments on commit 1614346

Please sign in to comment.