From 3f3894b90c411b1d897e62216a6dcbc7b5b035d5 Mon Sep 17 00:00:00 2001 From: vonhenry Date: Thu, 21 Nov 2019 10:37:50 +0800 Subject: [PATCH] update --- ibc.chain/include/ibc.chain/ibc.chain.hpp | 4 +++- ibc.chain/src/ibc.chain.cpp | 10 +++++++++- ibc.token/include/ibc.token/ibc.token.hpp | 3 +++ ibc.token/src/ibc.token.cpp | 10 +++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ibc.chain/include/ibc.chain/ibc.chain.hpp b/ibc.chain/include/ibc.chain/ibc.chain.hpp index ea0b916..8615076 100644 --- a/ibc.chain/include/ibc.chain/ibc.chain.hpp +++ b/ibc.chain/include/ibc.chain/ibc.chain.hpp @@ -172,7 +172,6 @@ namespace eosio { if ( check_relay_auth ) { relays _relays( ibc_contract_account, ibc_contract_account.value ); auto it = _relays.find( relay.value ); - return it != _relays.end(); eosio_assert( it != _relays.end(), "this account is not registered as relay"); require_auth( relay ); } @@ -182,6 +181,9 @@ namespace eosio { [[eosio::action]] void forceinit( ); + [[eosio::action]] + void reqrelayauth( ); + private: // pipeline pbft related void new_section( const signed_block_header& header, const incremental_merkle& blockroot_merkle ); diff --git a/ibc.chain/src/ibc.chain.cpp b/ibc.chain/src/ibc.chain.cpp index e574fa2..c405cb7 100644 --- a/ibc.chain/src/ibc.chain.cpp +++ b/ibc.chain/src/ibc.chain.cpp @@ -887,6 +887,14 @@ namespace eosio { eosio_assert(false,"unknown action"); } + void chain::reqrelayauth( ){ + if ( check_relay_auth ){ + eosio_assert( false, "check_relay_auth == true" ); + } else { + eosio_assert( false, "check_relay_auth == false" ); + } + } + } /// namespace eosio -EOSIO_DISPATCH( eosio::chain, (setglobal)(chaininit)(pushsection)(rmfirstsctn)(pushblkcmits)(forceinit)(relay) ) +EOSIO_DISPATCH( eosio::chain, (setglobal)(chaininit)(pushsection)(rmfirstsctn)(pushblkcmits)(forceinit)(relay)(reqrelayauth) ) diff --git a/ibc.token/include/ibc.token/ibc.token.hpp b/ibc.token/include/ibc.token/ibc.token.hpp index 0dd3e21..be55d73 100644 --- a/ibc.token/include/ibc.token/ibc.token.hpp +++ b/ibc.token/include/ibc.token/ibc.token.hpp @@ -202,6 +202,9 @@ namespace eosio { [[eosio::action]] void forceinit( name peerchain_name ); //force init + [[eosio::action]] + void reqrelayauth( ); + [[eosio::action]] void open( name owner, const symbol_code& symcode, name ram_payer ); diff --git a/ibc.token/src/ibc.token.cpp b/ibc.token/src/ibc.token.cpp index 4a3b631..4ceaafa 100644 --- a/ibc.token/src/ibc.token.cpp +++ b/ibc.token/src/ibc.token.cpp @@ -1310,6 +1310,14 @@ namespace eosio { } } + void token::reqrelayauth( ){ + if ( check_relay_auth ){ + eosio_assert( false, "check_relay_auth == true" ); + } else { + eosio_assert( false, "check_relay_auth == false" ); + } + } + } /// namespace eosio extern "C" { @@ -1320,7 +1328,7 @@ extern "C" { (regacpttoken)(setacptasset)(setacptstr)(setacptint)(setacptbool)(setacptfee) (regpegtoken)(setpegasset)(setpegint)(setpegbool)(setpegtkfee) (transfer)(cash)(cashconfirm)(rollback)(rmunablerb)(fcrollback)(fcrmorigtrx) - (lockall)(unlockall)(forceinit)(open)(close)) + (lockall)(unlockall)(forceinit)(open)(close)(reqrelayauth)) } return; }