Skip to content

Commit

Permalink
Missed file when commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
yarkinwho committed Aug 31, 2023
1 parent ea2eb46 commit ce2c477
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,9 @@ void evm_contract::process_filtered_messages(const std::vector<silkworm::Filtere
eosio::check(value >= min_fee, "min_fee not covered");

balances balance_table(get_self(), get_self().value);
const balance& receiver_account = balance_table.get(msg_v0.get_account_as_name().value, "receiver account is not open");
const balance& handler_account = balance_table.get(it->handler.value, "handler account is not open");

action(std::vector<permission_level>{}, msg_v0.get_account_as_name(), "onbridgemsg"_n,
action(std::vector<permission_level>{}, it->handler, "onbridgemsg"_n,
bridge_message{ bridge_message_v0 {
.receiver = msg_v0.get_account_as_name(),
.sender = to_bytes(rawmsg.sender),
Expand All @@ -423,7 +423,7 @@ void evm_contract::process_filtered_messages(const std::vector<silkworm::Filtere
} }
).send();

balance_table.modify(receiver_account, eosio::same_payer, [&](balance& row) {
balance_table.modify(handler_account, eosio::same_payer, [&](balance& row) {
row.balance += value;
});

Expand Down Expand Up @@ -699,7 +699,7 @@ void evm_contract::admincall(const bytes& from, const bytes& to, const bytes& va
call_(s, to, v, data, gas_limit, nonce);
}

void evm_contract::bridgereg(eosio::name receiver, const eosio::asset& min_fee) {
void evm_contract::bridgereg(eosio::name receiver, eosio::name handler, const eosio::asset& min_fee) {
assert_unfrozen();
require_auth(receiver);
require_auth(get_self()); // to temporarily prevent registration of unauthorized accounts
Expand All @@ -709,6 +709,7 @@ void evm_contract::bridgereg(eosio::name receiver, const eosio::asset& min_fee)

auto update_row = [&](auto& row) {
row.account = receiver;
row.handler = handler;
row.min_fee = min_fee;
row.flags = message_receiver::FORCE_ATOMIC;
};
Expand All @@ -722,7 +723,7 @@ void evm_contract::bridgereg(eosio::name receiver, const eosio::asset& min_fee)
message_receivers.modify(*it, eosio::same_payer, update_row);
}

open(receiver);
open(handler);
}

void evm_contract::bridgeunreg(eosio::name receiver) {
Expand Down

0 comments on commit ce2c477

Please sign in to comment.