fixed minor bugs, proofs working now

This commit is contained in:
cryptozoidberg 2021-06-27 01:24:04 +02:00
parent 11ef684b94
commit d49882fbc0
No known key found for this signature in database
GPG key ID: 22DEB97A54C6FDEC
5 changed files with 8 additions and 4 deletions

View file

@ -764,7 +764,7 @@ namespace currency
const crypto::key_derivation& m_key;
encrypt_attach_visitor(bool& was_crypted_entries, const crypto::key_derivation& key, const keypair& onetime_keypair = null_keypair, const account_public_address& destination_addr = null_pub_addr) :
m_was_crypted_entries(was_crypted_entries), m_key(key), m_onetime_keypair(onetime_keypair), m_destination_addr(m_destination_addr)
m_was_crypted_entries(was_crypted_entries), m_key(key), m_onetime_keypair(onetime_keypair), m_destination_addr(destination_addr)
{}
void operator()(tx_comment& comment)
{
@ -870,7 +870,7 @@ namespace currency
CHECK_AND_ASSERT_THROW_MES(m_acc_keys.spend_secret_key != currency::null_skey && m_tx_onetime_pubkey != currency::null_pkey, "tx_service_attachment with TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE: keys uninitialized");
bool r = crypto::generate_key_derivation(m_tx_onetime_pubkey, m_acc_keys.spend_secret_key, derivation_local);
CHECK_AND_ASSERT_THROW_MES(r, "Failed to generate_key_derivation at TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE");
crypto::chacha_crypt(sa.body, derivation_local);
crypto::chacha_crypt(local_sa.body, derivation_local);
}
else

View file

@ -1029,6 +1029,9 @@ int main(int argc, char* argv[])
GENERATE_AND_PLAY(atomic_test_wrong_redeem_wrong_refund);
GENERATE_AND_PLAY(atomic_test_altchain_simple);
GENERATE_AND_PLAY(atomic_test_check_hardfork_rules);
GENERATE_AND_PLAY(isolate_auditable_and_proof);
// GENERATE_AND_PLAY(gen_block_reward);

View file

@ -39,3 +39,4 @@
#include "hard_fork_1.h"
#include "hard_fork_2.h"
#include "atomic_tests.h"
#include "isolate_auditable_and_proof.h"

View file

@ -87,7 +87,7 @@ bool isolate_auditable_and_proof::c1(currency::core& c, size_t ev_index, const s
tx_service_attachment sa = AUTO_VAL_INIT(sa);
sa.service_id = BC_WRAP_SERVICE_ID;
sa.instruction = BC_WRAP_SERVICE_INSTRUCTION_ERC20;
sa.flags = TX_SERVICE_ATTACHMENT_ENCRYPT_BODY | TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE;
sa.flags = TX_SERVICE_ATTACHMENT_ENCRYPT_BODY | TX_SERVICE_ATTACHMENT_ENCRYPT_BODY_ISOLATE_AUDITABLE| TX_SERVICE_ATTACHMENT_ENCRYPT_ADD_PROOF;
sa.body = "0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B";
extra.push_back(sa);

View file

@ -11,7 +11,7 @@ struct isolate_auditable_and_proof : public wallet_test
{
isolate_auditable_and_proof();
bool generate(std::vector<test_event_entry>& events) const;
virtual bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events)=0;
virtual bool c1(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
virtual bool configure_core(currency::core& c, size_t ev_index, const std::vector<test_event_entry>& events);
protected:
mutable uint64_t m_genesis_timestamp;