Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove economic protocol handling #1889

Merged
merged 8 commits into from
Jul 2, 2024
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
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ members = [
# Test contracts
"contracts/alice",
"contracts/bob",
"contracts/charlie",
"contracts/host_fn",

# Genesis contracts
Expand Down
2 changes: 1 addition & 1 deletion contracts/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS := alice bob charlie license transfer stake host_fn
SUBDIRS := alice bob license transfer stake host_fn

all: $(SUBDIRS) ## Build all the contracts

Expand Down
15 changes: 0 additions & 15 deletions contracts/charlie/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions contracts/charlie/Makefile

This file was deleted.

53 changes: 0 additions & 53 deletions contracts/charlie/src/lib.rs

This file was deleted.

96 changes: 0 additions & 96 deletions contracts/charlie/src/state.rs

This file was deleted.

10 changes: 2 additions & 8 deletions contracts/stake/tests/common/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ use execution_core::{
SecretKey, Sender, TxSkeleton, ViewKey,
};
use rusk_abi::{
CallReceipt, ContractError, ContractId, EconomicMode, Error, Session,
TRANSFER_CONTRACT,
CallReceipt, ContractError, ContractId, Error, Session, TRANSFER_CONTRACT,
};

const POINT_LIMIT: u64 = 0x100000000;
Expand Down Expand Up @@ -147,12 +146,7 @@ pub fn execute(
.call::<_, ()>(
TRANSFER_CONTRACT,
"refund",
&(
tx.payload().fee,
receipt.gas_spent,
EconomicMode::None,
None::<ContractId>,
),
&(tx.payload().fee, receipt.gas_spent),
u64::MAX,
)
.expect("Refunding must succeed");
Expand Down
16 changes: 4 additions & 12 deletions contracts/transfer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ unsafe fn num_notes(arg_len: u32) -> u32 {
rusk_abi::wrap_call(arg_len, |_: ()| STATE.num_notes())
}

#[no_mangle]
unsafe fn gas_price(arg_len: u32) -> u32 {
rusk_abi::wrap_call(arg_len, |_: ()| STATE.gas_price())
}

// "Feeder" queries

#[no_mangle]
Expand All @@ -98,13 +93,10 @@ unsafe fn spend_and_execute(arg_len: u32) -> u32 {

#[no_mangle]
unsafe fn refund(arg_len: u32) -> u32 {
rusk_abi::wrap_call(
arg_len,
|(fee, gas_spent, economic_mode, contract_id)| {
assert_external_caller();
STATE.refund(fee, gas_spent, economic_mode, contract_id)
},
)
rusk_abi::wrap_call(arg_len, |(fee, gas_spent)| {
assert_external_caller();
STATE.refund(fee, gas_spent)
})
}

#[no_mangle]
Expand Down
Loading
Loading