diff --git a/src/dopt_pollublock_blockchain/blockchain.cpp b/src/dopt_pollublock_blockchain/blockchain.cpp index 620a291..567b2c3 100644 --- a/src/dopt_pollublock_blockchain/blockchain.cpp +++ b/src/dopt_pollublock_blockchain/blockchain.cpp @@ -1586,7 +1586,7 @@ static const char* const __pyx_f[] = { /* #### Code section: numeric_typedefs ### */ -/* "dopt_pollublock_blockchain/blockchain.pyx":26 +/* "dopt_pollublock_blockchain/blockchain.pyx":27 * * * ctypedef unsigned long ULong # <<<<<<<<<<<<<< @@ -1603,7 +1603,7 @@ struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain; struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_7PyBlock_from_ptr; struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_mine_block; -/* "dopt_pollublock_blockchain/blockchain.pyx":27 +/* "dopt_pollublock_blockchain/blockchain.pyx":28 * * ctypedef unsigned long ULong * ctypedef unordered_map[uint64_t, Block*] BcHashmap # <<<<<<<<<<<<<< @@ -1612,7 +1612,7 @@ struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_mine_block; */ typedef std::unordered_map __pyx_t_26dopt_pollublock_blockchain_10blockchain_BcHashmap; -/* "dopt_pollublock_blockchain/blockchain.pyx":122 +/* "dopt_pollublock_blockchain/blockchain.pyx":123 * * @staticmethod * cdef PyBlock from_ptr(Block *block, bint owner=False): # <<<<<<<<<<<<<< @@ -1624,7 +1624,7 @@ struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_7PyBlock_from_pt int owner; }; -/* "dopt_pollublock_blockchain/blockchain.pyx":291 +/* "dopt_pollublock_blockchain/blockchain.pyx":302 * * * cdef int mine_block(Block *block, unsigned int difficulty, uint64_t *nonce_solution, unsigned int max_nonce=0xFFFFFFFF) nogil: # <<<<<<<<<<<<<< @@ -1636,7 +1636,7 @@ struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_mine_block { unsigned int max_nonce; }; -/* "dopt_pollublock_blockchain/blockchain.pyx":86 +/* "dopt_pollublock_blockchain/blockchain.pyx":87 * * * cdef class PyBlock: # <<<<<<<<<<<<<< @@ -1651,7 +1651,7 @@ struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock { }; -/* "dopt_pollublock_blockchain/blockchain.pyx":322 +/* "dopt_pollublock_blockchain/blockchain.pyx":333 * * * cdef class Blockchain: # <<<<<<<<<<<<<< @@ -1673,7 +1673,7 @@ struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain { -/* "dopt_pollublock_blockchain/blockchain.pyx":86 +/* "dopt_pollublock_blockchain/blockchain.pyx":87 * * * cdef class PyBlock: # <<<<<<<<<<<<<< @@ -1687,7 +1687,7 @@ struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_PyBlock { static struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock; -/* "dopt_pollublock_blockchain/blockchain.pyx":322 +/* "dopt_pollublock_blockchain/blockchain.pyx":333 * * * cdef class Blockchain: # <<<<<<<<<<<<<< @@ -2804,17 +2804,18 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_2__init__ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__dealloc__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_6__repr__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_8__str__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10serialize_dict(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10as_dataclass(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12serialize_dict(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5index___get__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9timestamp___get__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4data___get__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9prev_hash___get__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5nonce___get__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4hash___get__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12bytes_serialize(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14perform_hash(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14bytes_serialize(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16perform_hash(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cinit__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__init__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *__pyx_v_self, PyObject *__pyx_v_db_path); /* proto */ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__dealloc__(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *__pyx_v_self); /* proto */ @@ -2867,8 +2868,8 @@ typedef struct { __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop; __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values; PyObject *__pyx_tuple[1]; - PyObject *__pyx_codeobj_tab[17]; - PyObject *__pyx_string_tab[189]; + PyObject *__pyx_codeobj_tab[18]; + PyObject *__pyx_string_tab[200]; PyObject *__pyx_number_tab[1]; /* #### Code section: module_state_contents ### */ /* CommonTypesMetaclass.module_state_decls */ @@ -2925,27 +2926,27 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_kp_u_Hash __pyx_string_tab[12] #define __pyx_kp_u_Hash_mismatch_Hash_of_previous __pyx_string_tab[13] #define __pyx_kp_u_Hashes_to_not_match_Abort __pyx_string_tab[14] -#define __pyx_kp_u_Index __pyx_string_tab[15] +#define __pyx_kp_u_Index_2 __pyx_string_tab[15] #define __pyx_kp_u_Index_value_is_out_of_bounds __pyx_string_tab[16] #define __pyx_kp_u_Maximum_number_must_be_greater_t __pyx_string_tab[17] -#define __pyx_kp_u_Prev_Hash __pyx_string_tab[18] -#define __pyx_kp_u_Provided_index_not_found __pyx_string_tab[19] -#define __pyx_kp_u_PyBlock_Index __pyx_string_tab[20] -#define __pyx_kp_u_The_parent_directory_of_the_prov __pyx_string_tab[21] -#define __pyx_kp_u_UTF_8 __pyx_string_tab[22] -#define __pyx_kp_u__2 __pyx_string_tab[23] -#define __pyx_kp_u__3 __pyx_string_tab[24] -#define __pyx_kp_u__4 __pyx_string_tab[25] -#define __pyx_kp_u_disable __pyx_string_tab[26] -#define __pyx_kp_u_enable __pyx_string_tab[27] -#define __pyx_kp_u_gc __pyx_string_tab[28] -#define __pyx_kp_u_isenabled __pyx_string_tab[29] -#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[30] -#define __pyx_kp_u_nonce_2 __pyx_string_tab[31] -#define __pyx_kp_u_sqlite __pyx_string_tab[32] -#define __pyx_kp_u_src_dopt_pollublock_blockchain_b __pyx_string_tab[33] -#define __pyx_kp_u_stringsource __pyx_string_tab[34] -#define __pyx_kp_u_timestamp_2 __pyx_string_tab[35] +#define __pyx_kp_u_Nonce __pyx_string_tab[18] +#define __pyx_kp_u_Prev_Hash __pyx_string_tab[19] +#define __pyx_kp_u_Provided_index_not_found __pyx_string_tab[20] +#define __pyx_kp_u_PyBlock_Index __pyx_string_tab[21] +#define __pyx_kp_u_The_parent_directory_of_the_prov __pyx_string_tab[22] +#define __pyx_kp_u_Timestamp __pyx_string_tab[23] +#define __pyx_kp_u_UTF_8 __pyx_string_tab[24] +#define __pyx_kp_u__2 __pyx_string_tab[25] +#define __pyx_kp_u__3 __pyx_string_tab[26] +#define __pyx_kp_u__4 __pyx_string_tab[27] +#define __pyx_kp_u_disable __pyx_string_tab[28] +#define __pyx_kp_u_enable __pyx_string_tab[29] +#define __pyx_kp_u_gc __pyx_string_tab[30] +#define __pyx_kp_u_isenabled __pyx_string_tab[31] +#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[32] +#define __pyx_kp_u_sqlite __pyx_string_tab[33] +#define __pyx_kp_u_src_dopt_pollublock_blockchain_b __pyx_string_tab[34] +#define __pyx_kp_u_stringsource __pyx_string_tab[35] #define __pyx_n_u_Blockchain __pyx_string_tab[36] #define __pyx_n_u_Blockchain___reduce_cython __pyx_string_tab[37] #define __pyx_n_u_Blockchain___setstate_cython __pyx_string_tab[38] @@ -2959,146 +2960,157 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_n_u_Blockchain_print_blocks __pyx_string_tab[46] #define __pyx_n_u_Blockchain_save __pyx_string_tab[47] #define __pyx_n_u_Blockchain_validate __pyx_string_tab[48] -#define __pyx_n_u_Path __pyx_string_tab[49] -#define __pyx_n_u_PyBlock __pyx_string_tab[50] -#define __pyx_n_u_PyBlock___reduce_cython __pyx_string_tab[51] -#define __pyx_n_u_PyBlock___setstate_cython __pyx_string_tab[52] -#define __pyx_n_u_PyBlock_bytes_serialize __pyx_string_tab[53] -#define __pyx_n_u_PyBlock_perform_hash __pyx_string_tab[54] -#define __pyx_n_u_PyBlock_serialize_dict __pyx_string_tab[55] -#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[56] -#define __pyx_n_u_TIMEZONE_UTC __pyx_string_tab[57] -#define __pyx_n_u_asc __pyx_string_tab[58] -#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[59] -#define __pyx_n_u_batch __pyx_string_tab[60] -#define __pyx_n_u_batch_size __pyx_string_tab[61] -#define __pyx_n_u_begin __pyx_string_tab[62] -#define __pyx_n_u_block __pyx_string_tab[63] -#define __pyx_n_u_blocks __pyx_string_tab[64] -#define __pyx_n_u_bytes_serialize __pyx_string_tab[65] -#define __pyx_n_u_c __pyx_string_tab[66] -#define __pyx_n_u_cline_in_traceback __pyx_string_tab[67] -#define __pyx_n_u_close_db_connections __pyx_string_tab[68] -#define __pyx_n_u_con __pyx_string_tab[69] -#define __pyx_n_u_conn __pyx_string_tab[70] -#define __pyx_n_u_connect __pyx_string_tab[71] -#define __pyx_n_u_contents __pyx_string_tab[72] -#define __pyx_n_u_create_all __pyx_string_tab[73] -#define __pyx_n_u_create_engine __pyx_string_tab[74] -#define __pyx_n_u_create_genesis_block __pyx_string_tab[75] -#define __pyx_n_u_current_time_tz __pyx_string_tab[76] -#define __pyx_n_u_cut_microseconds __pyx_string_tab[77] -#define __pyx_n_u_data __pyx_string_tab[78] -#define __pyx_n_u_data_digest __pyx_string_tab[79] -#define __pyx_n_u_data_str __pyx_string_tab[80] -#define __pyx_n_u_datetime __pyx_string_tab[81] -#define __pyx_n_u_db __pyx_string_tab[82] -#define __pyx_n_u_db_path __pyx_string_tab[83] -#define __pyx_n_u_digest __pyx_string_tab[84] -#define __pyx_n_u_digest_size __pyx_string_tab[85] -#define __pyx_n_u_dispose __pyx_string_tab[86] -#define __pyx_n_u_dopt_basics __pyx_string_tab[87] -#define __pyx_n_u_dopt_basics_datetime __pyx_string_tab[88] -#define __pyx_n_u_dopt_pollublock_blockchain __pyx_string_tab[89] -#define __pyx_n_u_dopt_pollublock_blockchain_block __pyx_string_tab[90] -#define __pyx_n_u_encode __pyx_string_tab[91] -#define __pyx_n_u_enter __pyx_string_tab[92] -#define __pyx_n_u_entries __pyx_string_tab[93] -#define __pyx_n_u_execute __pyx_string_tab[94] -#define __pyx_n_u_exists __pyx_string_tab[95] -#define __pyx_n_u_exit __pyx_string_tab[96] -#define __pyx_n_u_from_ptr __pyx_string_tab[97] -#define __pyx_n_u_fromhex __pyx_string_tab[98] -#define __pyx_n_u_fromtimestamp __pyx_string_tab[99] -#define __pyx_n_u_func __pyx_string_tab[100] -#define __pyx_n_u_func_2 __pyx_string_tab[101] -#define __pyx_n_u_genesis_done __pyx_string_tab[102] -#define __pyx_n_u_genesis_prev_hash __pyx_string_tab[103] -#define __pyx_n_u_get_block __pyx_string_tab[104] -#define __pyx_n_u_get_saving_entries __pyx_string_tab[105] -#define __pyx_n_u_getstate __pyx_string_tab[106] -#define __pyx_n_u_hash __pyx_string_tab[107] -#define __pyx_n_u_hex __pyx_string_tab[108] -#define __pyx_n_u_idx __pyx_string_tab[109] -#define __pyx_n_u_index __pyx_string_tab[110] -#define __pyx_n_u_insert __pyx_string_tab[111] -#define __pyx_n_u_is_coroutine __pyx_string_tab[112] -#define __pyx_n_u_it __pyx_string_tab[113] -#define __pyx_n_u_items __pyx_string_tab[114] -#define __pyx_n_u_load __pyx_string_tab[115] -#define __pyx_n_u_main __pyx_string_tab[116] -#define __pyx_n_u_max __pyx_string_tab[117] -#define __pyx_n_u_max_num __pyx_string_tab[118] -#define __pyx_n_u_max_nummber __pyx_string_tab[119] -#define __pyx_n_u_max_value __pyx_string_tab[120] -#define __pyx_n_u_metadata_blockchain __pyx_string_tab[121] -#define __pyx_n_u_min_idx __pyx_string_tab[122] -#define __pyx_n_u_min_idx_2 __pyx_string_tab[123] -#define __pyx_n_u_module __pyx_string_tab[124] -#define __pyx_n_u_name __pyx_string_tab[125] -#define __pyx_n_u_new_block __pyx_string_tab[126] -#define __pyx_n_u_new_idx __pyx_string_tab[127] -#define __pyx_n_u_nonce __pyx_string_tab[128] -#define __pyx_n_u_num __pyx_string_tab[129] -#define __pyx_n_u_order_by __pyx_string_tab[130] -#define __pyx_n_u_parent __pyx_string_tab[131] -#define __pyx_n_u_partitions __pyx_string_tab[132] -#define __pyx_n_u_pathlib __pyx_string_tab[133] -#define __pyx_n_u_perform_hash __pyx_string_tab[134] -#define __pyx_n_u_pop __pyx_string_tab[135] -#define __pyx_n_u_prev_block __pyx_string_tab[136] -#define __pyx_n_u_prev_hash __pyx_string_tab[137] -#define __pyx_n_u_previous_hash __pyx_string_tab[138] -#define __pyx_n_u_print __pyx_string_tab[139] -#define __pyx_n_u_print_blocks __pyx_string_tab[140] -#define __pyx_n_u_print_key_value_pair __pyx_string_tab[141] -#define __pyx_n_u_py_block __pyx_string_tab[142] -#define __pyx_n_u_py_bytes __pyx_string_tab[143] -#define __pyx_n_u_py_bytes_rehashed __pyx_string_tab[144] -#define __pyx_n_u_pyx_state __pyx_string_tab[145] -#define __pyx_n_u_pyx_vtable __pyx_string_tab[146] -#define __pyx_n_u_qualname __pyx_string_tab[147] -#define __pyx_n_u_reduce __pyx_string_tab[148] -#define __pyx_n_u_reduce_cython __pyx_string_tab[149] -#define __pyx_n_u_reduce_ex __pyx_string_tab[150] -#define __pyx_n_u_repr __pyx_string_tab[151] -#define __pyx_n_u_res __pyx_string_tab[152] -#define __pyx_n_u_resolve __pyx_string_tab[153] -#define __pyx_n_u_result __pyx_string_tab[154] -#define __pyx_n_u_save __pyx_string_tab[155] -#define __pyx_n_u_scalar __pyx_string_tab[156] -#define __pyx_n_u_select __pyx_string_tab[157] -#define __pyx_n_u_self __pyx_string_tab[158] -#define __pyx_n_u_serialize_dict __pyx_string_tab[159] -#define __pyx_n_u_serialize_res __pyx_string_tab[160] -#define __pyx_n_u_serialize_size __pyx_string_tab[161] -#define __pyx_n_u_set_name __pyx_string_tab[162] -#define __pyx_n_u_setdefault __pyx_string_tab[163] -#define __pyx_n_u_setstate __pyx_string_tab[164] -#define __pyx_n_u_setstate_cython __pyx_string_tab[165] -#define __pyx_n_u_sql __pyx_string_tab[166] -#define __pyx_n_u_sqlalchemy __pyx_string_tab[167] -#define __pyx_n_u_stmt __pyx_string_tab[168] -#define __pyx_n_u_test __pyx_string_tab[169] -#define __pyx_n_u_timestamp __pyx_string_tab[170] -#define __pyx_n_u_validate __pyx_string_tab[171] -#define __pyx_n_u_values __pyx_string_tab[172] -#define __pyx_kp_b_ __pyx_string_tab[173] -#define __pyx_kp_b_00000000000000000000000000000000 __pyx_string_tab[174] -#define __pyx_kp_b_iso88591_A_1D_wc_xuAV2_b_q_t1 __pyx_string_tab[175] -#define __pyx_kp_b_iso88591_A_1_D_q_G1_D_q_D_4q_4q_q __pyx_string_tab[176] -#define __pyx_kp_b_iso88591_A_4q_a_YgQa_t_Qa_IQ_Q_gQa_t_Qa_4 __pyx_string_tab[177] -#define __pyx_kp_b_iso88591_A_4q_aq_q_XQc_89ARwb_dRS_IS_1A_K __pyx_string_tab[178] -#define __pyx_kp_b_iso88591_A_4r_3d_D_AQ_D_AQ_6_A_AQ_iq_Q __pyx_string_tab[179] -#define __pyx_kp_b_iso88591_A_4t1_aq_4z_1A_4z_T_Qd_Ja_hb_IQ __pyx_string_tab[180] -#define __pyx_kp_b_iso88591_A_HHA __pyx_string_tab[181] -#define __pyx_kp_b_iso88591_A_Qd_1A __pyx_string_tab[182] -#define __pyx_kp_b_iso88591_A_T_F_c_D_4q_c_L_1_iq __pyx_string_tab[183] -#define __pyx_kp_b_iso88591_A_a_1_83a_AQ_G5_WARuA_D_q_1_iq_1 __pyx_string_tab[184] -#define __pyx_kp_b_iso88591_A_a_83a_q_G5_WARuA_t3a_D_q_1_q_A __pyx_string_tab[185] -#define __pyx_kp_b_iso88591_A_a_G5_WARuA_D_q_1_uHAU_waq_1G1A __pyx_string_tab[186] -#define __pyx_kp_b_iso88591_A_s_U_ar_q_T_gQ_4q_vQ_xq_7_2Zq __pyx_string_tab[187] -#define __pyx_kp_b_iso88591_Q __pyx_string_tab[188] +#define __pyx_n_u_Data_2 __pyx_string_tab[49] +#define __pyx_n_u_Hash_2 __pyx_string_tab[50] +#define __pyx_n_u_Index __pyx_string_tab[51] +#define __pyx_n_u_Nonce_2 __pyx_string_tab[52] +#define __pyx_n_u_Path __pyx_string_tab[53] +#define __pyx_n_u_PrevHash __pyx_string_tab[54] +#define __pyx_n_u_PyBlock __pyx_string_tab[55] +#define __pyx_n_u_PyBlockData __pyx_string_tab[56] +#define __pyx_n_u_PyBlock___reduce_cython __pyx_string_tab[57] +#define __pyx_n_u_PyBlock___setstate_cython __pyx_string_tab[58] +#define __pyx_n_u_PyBlock_as_dataclass __pyx_string_tab[59] +#define __pyx_n_u_PyBlock_bytes_serialize __pyx_string_tab[60] +#define __pyx_n_u_PyBlock_perform_hash __pyx_string_tab[61] +#define __pyx_n_u_PyBlock_serialize_dict __pyx_string_tab[62] +#define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[63] +#define __pyx_n_u_TIMEZONE_UTC __pyx_string_tab[64] +#define __pyx_n_u_Timestamp_2 __pyx_string_tab[65] +#define __pyx_n_u_as_dataclass __pyx_string_tab[66] +#define __pyx_n_u_asc __pyx_string_tab[67] +#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[68] +#define __pyx_n_u_batch __pyx_string_tab[69] +#define __pyx_n_u_batch_size __pyx_string_tab[70] +#define __pyx_n_u_begin __pyx_string_tab[71] +#define __pyx_n_u_block __pyx_string_tab[72] +#define __pyx_n_u_blocks __pyx_string_tab[73] +#define __pyx_n_u_bytes_serialize __pyx_string_tab[74] +#define __pyx_n_u_c __pyx_string_tab[75] +#define __pyx_n_u_cline_in_traceback __pyx_string_tab[76] +#define __pyx_n_u_close_db_connections __pyx_string_tab[77] +#define __pyx_n_u_con __pyx_string_tab[78] +#define __pyx_n_u_conn __pyx_string_tab[79] +#define __pyx_n_u_connect __pyx_string_tab[80] +#define __pyx_n_u_contents __pyx_string_tab[81] +#define __pyx_n_u_create_all __pyx_string_tab[82] +#define __pyx_n_u_create_engine __pyx_string_tab[83] +#define __pyx_n_u_create_genesis_block __pyx_string_tab[84] +#define __pyx_n_u_current_time_tz __pyx_string_tab[85] +#define __pyx_n_u_cut_microseconds __pyx_string_tab[86] +#define __pyx_n_u_data __pyx_string_tab[87] +#define __pyx_n_u_data_digest __pyx_string_tab[88] +#define __pyx_n_u_data_str __pyx_string_tab[89] +#define __pyx_n_u_datetime __pyx_string_tab[90] +#define __pyx_n_u_db __pyx_string_tab[91] +#define __pyx_n_u_db_path __pyx_string_tab[92] +#define __pyx_n_u_digest __pyx_string_tab[93] +#define __pyx_n_u_digest_size __pyx_string_tab[94] +#define __pyx_n_u_dispose __pyx_string_tab[95] +#define __pyx_n_u_dopt_basics __pyx_string_tab[96] +#define __pyx_n_u_dopt_basics_datetime __pyx_string_tab[97] +#define __pyx_n_u_dopt_pollublock_blockchain __pyx_string_tab[98] +#define __pyx_n_u_dopt_pollublock_blockchain_block __pyx_string_tab[99] +#define __pyx_n_u_encode __pyx_string_tab[100] +#define __pyx_n_u_enter __pyx_string_tab[101] +#define __pyx_n_u_entries __pyx_string_tab[102] +#define __pyx_n_u_execute __pyx_string_tab[103] +#define __pyx_n_u_exists __pyx_string_tab[104] +#define __pyx_n_u_exit __pyx_string_tab[105] +#define __pyx_n_u_from_ptr __pyx_string_tab[106] +#define __pyx_n_u_fromhex __pyx_string_tab[107] +#define __pyx_n_u_fromtimestamp __pyx_string_tab[108] +#define __pyx_n_u_func __pyx_string_tab[109] +#define __pyx_n_u_func_2 __pyx_string_tab[110] +#define __pyx_n_u_genesis_done __pyx_string_tab[111] +#define __pyx_n_u_genesis_prev_hash __pyx_string_tab[112] +#define __pyx_n_u_get_block __pyx_string_tab[113] +#define __pyx_n_u_get_saving_entries __pyx_string_tab[114] +#define __pyx_n_u_getstate __pyx_string_tab[115] +#define __pyx_n_u_hash __pyx_string_tab[116] +#define __pyx_n_u_hex __pyx_string_tab[117] +#define __pyx_n_u_idx __pyx_string_tab[118] +#define __pyx_n_u_index __pyx_string_tab[119] +#define __pyx_n_u_insert __pyx_string_tab[120] +#define __pyx_n_u_is_coroutine __pyx_string_tab[121] +#define __pyx_n_u_it __pyx_string_tab[122] +#define __pyx_n_u_items __pyx_string_tab[123] +#define __pyx_n_u_load __pyx_string_tab[124] +#define __pyx_n_u_main __pyx_string_tab[125] +#define __pyx_n_u_max __pyx_string_tab[126] +#define __pyx_n_u_max_num __pyx_string_tab[127] +#define __pyx_n_u_max_nummber __pyx_string_tab[128] +#define __pyx_n_u_max_value __pyx_string_tab[129] +#define __pyx_n_u_metadata_blockchain __pyx_string_tab[130] +#define __pyx_n_u_min_idx __pyx_string_tab[131] +#define __pyx_n_u_min_idx_2 __pyx_string_tab[132] +#define __pyx_n_u_module __pyx_string_tab[133] +#define __pyx_n_u_name __pyx_string_tab[134] +#define __pyx_n_u_new_block __pyx_string_tab[135] +#define __pyx_n_u_new_idx __pyx_string_tab[136] +#define __pyx_n_u_nonce __pyx_string_tab[137] +#define __pyx_n_u_num __pyx_string_tab[138] +#define __pyx_n_u_order_by __pyx_string_tab[139] +#define __pyx_n_u_parent __pyx_string_tab[140] +#define __pyx_n_u_partitions __pyx_string_tab[141] +#define __pyx_n_u_pathlib __pyx_string_tab[142] +#define __pyx_n_u_perform_hash __pyx_string_tab[143] +#define __pyx_n_u_pop __pyx_string_tab[144] +#define __pyx_n_u_prev_block __pyx_string_tab[145] +#define __pyx_n_u_prev_hash __pyx_string_tab[146] +#define __pyx_n_u_previous_hash __pyx_string_tab[147] +#define __pyx_n_u_print __pyx_string_tab[148] +#define __pyx_n_u_print_blocks __pyx_string_tab[149] +#define __pyx_n_u_print_key_value_pair __pyx_string_tab[150] +#define __pyx_n_u_py_block __pyx_string_tab[151] +#define __pyx_n_u_py_bytes __pyx_string_tab[152] +#define __pyx_n_u_py_bytes_rehashed __pyx_string_tab[153] +#define __pyx_n_u_pyx_state __pyx_string_tab[154] +#define __pyx_n_u_pyx_vtable __pyx_string_tab[155] +#define __pyx_n_u_qualname __pyx_string_tab[156] +#define __pyx_n_u_reduce __pyx_string_tab[157] +#define __pyx_n_u_reduce_cython __pyx_string_tab[158] +#define __pyx_n_u_reduce_ex __pyx_string_tab[159] +#define __pyx_n_u_repr __pyx_string_tab[160] +#define __pyx_n_u_res __pyx_string_tab[161] +#define __pyx_n_u_resolve __pyx_string_tab[162] +#define __pyx_n_u_result __pyx_string_tab[163] +#define __pyx_n_u_save __pyx_string_tab[164] +#define __pyx_n_u_scalar __pyx_string_tab[165] +#define __pyx_n_u_select __pyx_string_tab[166] +#define __pyx_n_u_self __pyx_string_tab[167] +#define __pyx_n_u_serialize_dict __pyx_string_tab[168] +#define __pyx_n_u_serialize_res __pyx_string_tab[169] +#define __pyx_n_u_serialize_size __pyx_string_tab[170] +#define __pyx_n_u_set_name __pyx_string_tab[171] +#define __pyx_n_u_setdefault __pyx_string_tab[172] +#define __pyx_n_u_setstate __pyx_string_tab[173] +#define __pyx_n_u_setstate_cython __pyx_string_tab[174] +#define __pyx_n_u_sql __pyx_string_tab[175] +#define __pyx_n_u_sqlalchemy __pyx_string_tab[176] +#define __pyx_n_u_stmt __pyx_string_tab[177] +#define __pyx_n_u_test __pyx_string_tab[178] +#define __pyx_n_u_timestamp __pyx_string_tab[179] +#define __pyx_n_u_types __pyx_string_tab[180] +#define __pyx_n_u_validate __pyx_string_tab[181] +#define __pyx_n_u_values __pyx_string_tab[182] +#define __pyx_kp_b_ __pyx_string_tab[183] +#define __pyx_kp_b_00000000000000000000000000000000 __pyx_string_tab[184] +#define __pyx_kp_b_iso88591_A_1D_wc_xuAV2_b_q_t1 __pyx_string_tab[185] +#define __pyx_kp_b_iso88591_A_1_D_q_G1_D_q_D_4q_4q_q __pyx_string_tab[186] +#define __pyx_kp_b_iso88591_A_4q_a_YgQa_t_Qa_IQ_Q_gQa_t_Qa_4 __pyx_string_tab[187] +#define __pyx_kp_b_iso88591_A_4q_aq_q_XQc_89ARwb_dRS_IS_1A_K __pyx_string_tab[188] +#define __pyx_kp_b_iso88591_A_4r_3d_D_AQ_D_AQ_6_A_AQ_iq_Q __pyx_string_tab[189] +#define __pyx_kp_b_iso88591_A_4t1_aq_4z_1A_4z_T_Qd_Ja_hb_IQ __pyx_string_tab[190] +#define __pyx_kp_b_iso88591_A_HHA __pyx_string_tab[191] +#define __pyx_kp_b_iso88591_A_Qd_1A __pyx_string_tab[192] +#define __pyx_kp_b_iso88591_A_T_F_c_D_4q_c_L_1_iq __pyx_string_tab[193] +#define __pyx_kp_b_iso88591_A_a_1_83a_AQ_G5_WARuA_D_q_1_iq_1 __pyx_string_tab[194] +#define __pyx_kp_b_iso88591_A_a_83a_q_G5_WARuA_t3a_D_q_1_q_A __pyx_string_tab[195] +#define __pyx_kp_b_iso88591_A_a_G5_WARuA_D_q_1_uHAU_waq_1G1A __pyx_string_tab[196] +#define __pyx_kp_b_iso88591_A_s_U_ar_q_T_gQ_4q_vQ_xq_7_2Zq __pyx_string_tab[197] +#define __pyx_kp_b_iso88591_A_uL_a_d_a_T_Q_Q __pyx_string_tab[198] +#define __pyx_kp_b_iso88591_Q __pyx_string_tab[199] #define __pyx_int_0 __pyx_number_tab[0] /* #### Code section: module_state_clear ### */ #if CYTHON_USE_MODULE_STATE @@ -3119,8 +3131,8 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain); Py_CLEAR(clear_module_state->__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain); for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); } - for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<189; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } + for (int i=0; i<18; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<200; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); } for (int i=0; i<1; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_clear_contents ### */ /* CommonTypesMetaclass.module_state_clear */ @@ -3149,8 +3161,8 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void Py_VISIT(traverse_module_state->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain); Py_VISIT(traverse_module_state->__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain); for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); } - for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } - for (int i=0; i<189; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } + for (int i=0; i<18; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); } + for (int i=0; i<200; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); } for (int i=0; i<1; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); } /* #### Code section: module_state_traverse_contents ### */ /* CommonTypesMetaclass.module_state_traverse */ @@ -3546,7 +3558,7 @@ static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6s return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":31 +/* "dopt_pollublock_blockchain/blockchain.pyx":32 * * * cdef timestamp_to_datetime(uint64_t ts): # <<<<<<<<<<<<<< @@ -3569,7 +3581,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_timestamp_to_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("timestamp_to_datetime", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":32 + /* "dopt_pollublock_blockchain/blockchain.pyx":33 * * cdef timestamp_to_datetime(uint64_t ts): * return datetime.datetime.fromtimestamp(float(ts), dopt_basics.datetime.TIMEZONE_UTC) # <<<<<<<<<<<<<< @@ -3577,21 +3589,21 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_timestamp_to_ * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyFloat_FromDouble(((double)__pyx_v_ts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble(((double)__pyx_v_ts)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dopt_basics); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_dopt_basics); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TIMEZONE_UTC); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_TIMEZONE_UTC); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 0; @@ -3602,14 +3614,14 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_timestamp_to_ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":31 + /* "dopt_pollublock_blockchain/blockchain.pyx":32 * * * cdef timestamp_to_datetime(uint64_t ts): # <<<<<<<<<<<<<< @@ -3633,7 +3645,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_timestamp_to_ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":35 +/* "dopt_pollublock_blockchain/blockchain.pyx":36 * * * cdef uint64_t current_timestamp_integer(): # <<<<<<<<<<<<<< @@ -3657,16 +3669,16 @@ static uint64_t __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timest int __pyx_clineno = 0; __Pyx_RefNannySetupContext("current_timestamp_integer", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":37 + /* "dopt_pollublock_blockchain/blockchain.pyx":38 * cdef uint64_t current_timestamp_integer(): * cdef uint64_t ts * dt = dopt_basics.datetime.current_time_tz(cut_microseconds=True) # <<<<<<<<<<<<<< * ts = int(dt.timestamp()) * return ts */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dopt_basics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_dopt_basics); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; @@ -3674,20 +3686,20 @@ static uint64_t __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timest __pyx_t_5 = 0; { PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, NULL}; - __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error) + __pyx_t_3 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cut_microseconds, Py_True, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 37, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_cut_microseconds, Py_True, __pyx_t_3, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 38, __pyx_L1_error) __pyx_t_1 = __Pyx_Object_VectorcallMethod_CallFromBuilder((PyObject*)__pyx_mstate_global->__pyx_n_u_current_time_tz, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_dt = __pyx_t_1; __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":38 + /* "dopt_pollublock_blockchain/blockchain.pyx":39 * cdef uint64_t ts * dt = dopt_basics.datetime.current_time_tz(cut_microseconds=True) * ts = int(dt.timestamp()) # <<<<<<<<<<<<<< @@ -3701,17 +3713,17 @@ static uint64_t __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timest PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_timestamp, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 38, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 39, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ts = ((uint64_t)__pyx_t_6); - /* "dopt_pollublock_blockchain/blockchain.pyx":39 + /* "dopt_pollublock_blockchain/blockchain.pyx":40 * dt = dopt_basics.datetime.current_time_tz(cut_microseconds=True) * ts = int(dt.timestamp()) * return ts # <<<<<<<<<<<<<< @@ -3721,7 +3733,7 @@ static uint64_t __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timest __pyx_r = __pyx_v_ts; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":35 + /* "dopt_pollublock_blockchain/blockchain.pyx":36 * * * cdef uint64_t current_timestamp_integer(): # <<<<<<<<<<<<<< @@ -3743,7 +3755,7 @@ static uint64_t __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timest return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":42 +/* "dopt_pollublock_blockchain/blockchain.pyx":43 * * * cdef int serialize_uint32(unsigned char* out, unsigned int v) except -1 nogil: # <<<<<<<<<<<<<< @@ -3754,7 +3766,7 @@ static uint64_t __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timest static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(unsigned char *__pyx_v_out, unsigned int __pyx_v_v) { int __pyx_r; - /* "dopt_pollublock_blockchain/blockchain.pyx":43 + /* "dopt_pollublock_blockchain/blockchain.pyx":44 * * cdef int serialize_uint32(unsigned char* out, unsigned int v) except -1 nogil: * out[0] = (v >> 24) & 0xFF # <<<<<<<<<<<<<< @@ -3763,7 +3775,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(un */ (__pyx_v_out[0]) = ((__pyx_v_v >> 24) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":44 + /* "dopt_pollublock_blockchain/blockchain.pyx":45 * cdef int serialize_uint32(unsigned char* out, unsigned int v) except -1 nogil: * out[0] = (v >> 24) & 0xFF * out[1] = (v >> 16) & 0xFF # <<<<<<<<<<<<<< @@ -3772,7 +3784,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(un */ (__pyx_v_out[1]) = ((__pyx_v_v >> 16) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":45 + /* "dopt_pollublock_blockchain/blockchain.pyx":46 * out[0] = (v >> 24) & 0xFF * out[1] = (v >> 16) & 0xFF * out[2] = (v >> 8) & 0xFF # <<<<<<<<<<<<<< @@ -3781,7 +3793,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(un */ (__pyx_v_out[2]) = ((__pyx_v_v >> 8) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":46 + /* "dopt_pollublock_blockchain/blockchain.pyx":47 * out[1] = (v >> 16) & 0xFF * out[2] = (v >> 8) & 0xFF * out[3] = v & 0xFF # <<<<<<<<<<<<<< @@ -3790,7 +3802,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(un */ (__pyx_v_out[3]) = (__pyx_v_v & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":42 + /* "dopt_pollublock_blockchain/blockchain.pyx":43 * * * cdef int serialize_uint32(unsigned char* out, unsigned int v) except -1 nogil: # <<<<<<<<<<<<<< @@ -3803,7 +3815,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(un return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":49 +/* "dopt_pollublock_blockchain/blockchain.pyx":50 * * * cdef int serialize_uint64(unsigned char* out, unsigned long long v) except -1 nogil: # <<<<<<<<<<<<<< @@ -3814,7 +3826,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint32(un static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(unsigned char *__pyx_v_out, unsigned PY_LONG_LONG __pyx_v_v) { int __pyx_r; - /* "dopt_pollublock_blockchain/blockchain.pyx":50 + /* "dopt_pollublock_blockchain/blockchain.pyx":51 * * cdef int serialize_uint64(unsigned char* out, unsigned long long v) except -1 nogil: * out[0] = (v >> 56) & 0xFF # <<<<<<<<<<<<<< @@ -3823,7 +3835,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[0]) = ((__pyx_v_v >> 56) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":51 + /* "dopt_pollublock_blockchain/blockchain.pyx":52 * cdef int serialize_uint64(unsigned char* out, unsigned long long v) except -1 nogil: * out[0] = (v >> 56) & 0xFF * out[1] = (v >> 48) & 0xFF # <<<<<<<<<<<<<< @@ -3832,7 +3844,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[1]) = ((__pyx_v_v >> 48) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":52 + /* "dopt_pollublock_blockchain/blockchain.pyx":53 * out[0] = (v >> 56) & 0xFF * out[1] = (v >> 48) & 0xFF * out[2] = (v >> 40) & 0xFF # <<<<<<<<<<<<<< @@ -3841,7 +3853,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[2]) = ((__pyx_v_v >> 40) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":53 + /* "dopt_pollublock_blockchain/blockchain.pyx":54 * out[1] = (v >> 48) & 0xFF * out[2] = (v >> 40) & 0xFF * out[3] = (v >> 32) & 0xFF # <<<<<<<<<<<<<< @@ -3850,7 +3862,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[3]) = ((__pyx_v_v >> 32) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":54 + /* "dopt_pollublock_blockchain/blockchain.pyx":55 * out[2] = (v >> 40) & 0xFF * out[3] = (v >> 32) & 0xFF * out[4] = (v >> 24) & 0xFF # <<<<<<<<<<<<<< @@ -3859,7 +3871,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[4]) = ((__pyx_v_v >> 24) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":55 + /* "dopt_pollublock_blockchain/blockchain.pyx":56 * out[3] = (v >> 32) & 0xFF * out[4] = (v >> 24) & 0xFF * out[5] = (v >> 16) & 0xFF # <<<<<<<<<<<<<< @@ -3868,7 +3880,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[5]) = ((__pyx_v_v >> 16) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":56 + /* "dopt_pollublock_blockchain/blockchain.pyx":57 * out[4] = (v >> 24) & 0xFF * out[5] = (v >> 16) & 0xFF * out[6] = (v >> 8) & 0xFF # <<<<<<<<<<<<<< @@ -3877,7 +3889,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[6]) = ((__pyx_v_v >> 8) & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":57 + /* "dopt_pollublock_blockchain/blockchain.pyx":58 * out[5] = (v >> 16) & 0xFF * out[6] = (v >> 8) & 0xFF * out[7] = v & 0xFF # <<<<<<<<<<<<<< @@ -3886,7 +3898,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un */ (__pyx_v_out[7]) = (__pyx_v_v & 0xFF); - /* "dopt_pollublock_blockchain/blockchain.pyx":49 + /* "dopt_pollublock_blockchain/blockchain.pyx":50 * * * cdef int serialize_uint64(unsigned char* out, unsigned long long v) except -1 nogil: # <<<<<<<<<<<<<< @@ -3899,7 +3911,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64(un return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":60 +/* "dopt_pollublock_blockchain/blockchain.pyx":61 * * * cdef inline bint has_leading_zero_bits(const unsigned char *digest, int num_bits) nogil: # <<<<<<<<<<<<<< @@ -3917,7 +3929,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l int __pyx_t_3; int __pyx_t_4; - /* "dopt_pollublock_blockchain/blockchain.pyx":61 + /* "dopt_pollublock_blockchain/blockchain.pyx":62 * * cdef inline bint has_leading_zero_bits(const unsigned char *digest, int num_bits) nogil: * cdef int i, full_bytes = num_bits // 8 # <<<<<<<<<<<<<< @@ -3926,7 +3938,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l */ __pyx_v_full_bytes = __Pyx_div_long(__pyx_v_num_bits, 8, 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":62 + /* "dopt_pollublock_blockchain/blockchain.pyx":63 * cdef inline bint has_leading_zero_bits(const unsigned char *digest, int num_bits) nogil: * cdef int i, full_bytes = num_bits // 8 * cdef int rem_bits = num_bits % 8 # <<<<<<<<<<<<<< @@ -3935,7 +3947,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l */ __pyx_v_rem_bits = __Pyx_mod_long(__pyx_v_num_bits, 8, 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":64 + /* "dopt_pollublock_blockchain/blockchain.pyx":65 * cdef int rem_bits = num_bits % 8 * * for i in range(full_bytes): # <<<<<<<<<<<<<< @@ -3947,7 +3959,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "dopt_pollublock_blockchain/blockchain.pyx":65 + /* "dopt_pollublock_blockchain/blockchain.pyx":66 * * for i in range(full_bytes): * if digest[i] != 0: # <<<<<<<<<<<<<< @@ -3957,7 +3969,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_t_4 = ((__pyx_v_digest[__pyx_v_i]) != 0); if (__pyx_t_4) { - /* "dopt_pollublock_blockchain/blockchain.pyx":66 + /* "dopt_pollublock_blockchain/blockchain.pyx":67 * for i in range(full_bytes): * if digest[i] != 0: * return False # <<<<<<<<<<<<<< @@ -3967,7 +3979,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_r = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":65 + /* "dopt_pollublock_blockchain/blockchain.pyx":66 * * for i in range(full_bytes): * if digest[i] != 0: # <<<<<<<<<<<<<< @@ -3977,7 +3989,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l } } - /* "dopt_pollublock_blockchain/blockchain.pyx":68 + /* "dopt_pollublock_blockchain/blockchain.pyx":69 * return False * * if rem_bits: # <<<<<<<<<<<<<< @@ -3987,7 +3999,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_t_4 = (__pyx_v_rem_bits != 0); if (__pyx_t_4) { - /* "dopt_pollublock_blockchain/blockchain.pyx":69 + /* "dopt_pollublock_blockchain/blockchain.pyx":70 * * if rem_bits: * if digest[full_bytes] >> (8 - rem_bits) != 0: # <<<<<<<<<<<<<< @@ -3997,7 +4009,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_t_4 = (((__pyx_v_digest[__pyx_v_full_bytes]) >> (8 - __pyx_v_rem_bits)) != 0); if (__pyx_t_4) { - /* "dopt_pollublock_blockchain/blockchain.pyx":70 + /* "dopt_pollublock_blockchain/blockchain.pyx":71 * if rem_bits: * if digest[full_bytes] >> (8 - rem_bits) != 0: * return False # <<<<<<<<<<<<<< @@ -4007,7 +4019,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_r = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":69 + /* "dopt_pollublock_blockchain/blockchain.pyx":70 * * if rem_bits: * if digest[full_bytes] >> (8 - rem_bits) != 0: # <<<<<<<<<<<<<< @@ -4016,7 +4028,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":68 + /* "dopt_pollublock_blockchain/blockchain.pyx":69 * return False * * if rem_bits: # <<<<<<<<<<<<<< @@ -4025,7 +4037,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":72 + /* "dopt_pollublock_blockchain/blockchain.pyx":73 * return False * * return True # <<<<<<<<<<<<<< @@ -4035,7 +4047,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_r = 1; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":60 + /* "dopt_pollublock_blockchain/blockchain.pyx":61 * * * cdef inline bint has_leading_zero_bits(const unsigned char *digest, int num_bits) nogil: # <<<<<<<<<<<<<< @@ -4048,7 +4060,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":75 +/* "dopt_pollublock_blockchain/blockchain.pyx":76 * * * cdef inline bint has_leading_zero_bytes(const unsigned char *digest, int num_bytes) nogil: # <<<<<<<<<<<<<< @@ -4066,7 +4078,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l int __pyx_t_3; int __pyx_t_4; - /* "dopt_pollublock_blockchain/blockchain.pyx":76 + /* "dopt_pollublock_blockchain/blockchain.pyx":77 * * cdef inline bint has_leading_zero_bytes(const unsigned char *digest, int num_bytes) nogil: * cdef int i, full_bytes = num_bytes // 8 # <<<<<<<<<<<<<< @@ -4075,7 +4087,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l */ __pyx_v_full_bytes = __Pyx_div_long(__pyx_v_num_bytes, 8, 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":77 + /* "dopt_pollublock_blockchain/blockchain.pyx":78 * cdef inline bint has_leading_zero_bytes(const unsigned char *digest, int num_bytes) nogil: * cdef int i, full_bytes = num_bytes // 8 * cdef int rem_bits = num_bytes % 8 # <<<<<<<<<<<<<< @@ -4084,7 +4096,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l */ __pyx_v_rem_bits = __Pyx_mod_long(__pyx_v_num_bytes, 8, 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":79 + /* "dopt_pollublock_blockchain/blockchain.pyx":80 * cdef int rem_bits = num_bytes % 8 * * for i in range(num_bytes): # <<<<<<<<<<<<<< @@ -4096,7 +4108,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_i = __pyx_t_3; - /* "dopt_pollublock_blockchain/blockchain.pyx":80 + /* "dopt_pollublock_blockchain/blockchain.pyx":81 * * for i in range(num_bytes): * if digest[i] != 0: # <<<<<<<<<<<<<< @@ -4106,7 +4118,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_t_4 = ((__pyx_v_digest[__pyx_v_i]) != 0); if (__pyx_t_4) { - /* "dopt_pollublock_blockchain/blockchain.pyx":81 + /* "dopt_pollublock_blockchain/blockchain.pyx":82 * for i in range(num_bytes): * if digest[i] != 0: * return False # <<<<<<<<<<<<<< @@ -4116,7 +4128,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_r = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":80 + /* "dopt_pollublock_blockchain/blockchain.pyx":81 * * for i in range(num_bytes): * if digest[i] != 0: # <<<<<<<<<<<<<< @@ -4126,7 +4138,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l } } - /* "dopt_pollublock_blockchain/blockchain.pyx":83 + /* "dopt_pollublock_blockchain/blockchain.pyx":84 * return False * * return True # <<<<<<<<<<<<<< @@ -4136,7 +4148,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l __pyx_r = 1; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":75 + /* "dopt_pollublock_blockchain/blockchain.pyx":76 * * * cdef inline bint has_leading_zero_bytes(const unsigned char *digest, int num_bytes) nogil: # <<<<<<<<<<<<<< @@ -4149,7 +4161,7 @@ static CYTHON_INLINE int __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_l return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":91 +/* "dopt_pollublock_blockchain/blockchain.pyx":92 * bint ptr_owner * * def __cinit__(self, # <<<<<<<<<<<<<< @@ -4183,36 +4195,36 @@ static int __pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_1__cinit_ { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_index,&__pyx_mstate_global->__pyx_n_u_nonce,&__pyx_mstate_global->__pyx_n_u_data,&__pyx_mstate_global->__pyx_n_u_previous_hash,&__pyx_mstate_global->__pyx_n_u_from_ptr,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 91, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 92, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 91, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < (0)) __PYX_ERR(0, 92, __pyx_L3_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":96 + /* "dopt_pollublock_blockchain/blockchain.pyx":97 * data, * previous_hash, * from_ptr=False, # <<<<<<<<<<<<<< @@ -4221,23 +4233,23 @@ static int __pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_1__cinit_ */ if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_False)); for (Py_ssize_t i = __pyx_nargs; i < 4; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, i); __PYX_ERR(0, 91, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, i); __PYX_ERR(0, 92, __pyx_L3_error) } } } else { switch (__pyx_nargs) { case 5: values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 92, __pyx_L3_error) CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 92, __pyx_L3_error) values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 92, __pyx_L3_error) values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 92, __pyx_L3_error) values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 91, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 92, __pyx_L3_error) break; default: goto __pyx_L5_argtuple_error; } @@ -4251,7 +4263,7 @@ static int __pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_1__cinit_ } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 91, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 92, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -4264,7 +4276,7 @@ static int __pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_1__cinit_ __pyx_L4_argument_unpacking_done:; __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self), __pyx_v_index, __pyx_v_nonce, __pyx_v_data, __pyx_v_previous_hash, __pyx_v_from_ptr); - /* "dopt_pollublock_blockchain/blockchain.pyx":91 + /* "dopt_pollublock_blockchain/blockchain.pyx":92 * bint ptr_owner * * def __cinit__(self, # <<<<<<<<<<<<<< @@ -4300,7 +4312,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":98 + /* "dopt_pollublock_blockchain/blockchain.pyx":99 * from_ptr=False, * ): * self.ptr_owner = False # <<<<<<<<<<<<<< @@ -4309,45 +4321,45 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ */ __pyx_v_self->ptr_owner = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":99 + /* "dopt_pollublock_blockchain/blockchain.pyx":100 * ): * self.ptr_owner = False * if not from_ptr: # <<<<<<<<<<<<<< * self.BlockC = new Block( * index, */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_from_ptr); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 99, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_from_ptr); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 100, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":101 + /* "dopt_pollublock_blockchain/blockchain.pyx":102 * if not from_ptr: * self.BlockC = new Block( * index, # <<<<<<<<<<<<<< * current_timestamp_integer(), * nonce, */ - __pyx_t_3 = __Pyx_PyLong_As_uint64_t(__pyx_v_index); if (unlikely((__pyx_t_3 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_uint64_t(__pyx_v_index); if (unlikely((__pyx_t_3 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":102 + /* "dopt_pollublock_blockchain/blockchain.pyx":103 * self.BlockC = new Block( * index, * current_timestamp_integer(), # <<<<<<<<<<<<<< * nonce, * data.encode("UTF-8"), */ - __pyx_t_4 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timestamp_integer(); if (unlikely(__pyx_t_4 == ((uint64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 102, __pyx_L1_error) + __pyx_t_4 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timestamp_integer(); if (unlikely(__pyx_t_4 == ((uint64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":103 + /* "dopt_pollublock_blockchain/blockchain.pyx":104 * index, * current_timestamp_integer(), * nonce, # <<<<<<<<<<<<<< * data.encode("UTF-8"), * previous_hash.encode("UTF-8"), */ - __pyx_t_5 = __Pyx_PyLong_As_uint64_t(__pyx_v_nonce); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 103, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_As_uint64_t(__pyx_v_nonce); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":104 + /* "dopt_pollublock_blockchain/blockchain.pyx":105 * current_timestamp_integer(), * nonce, * data.encode("UTF-8"), # <<<<<<<<<<<<<< @@ -4361,13 +4373,13 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_UTF_8}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 104, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 104, __pyx_L1_error) + __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":105 + /* "dopt_pollublock_blockchain/blockchain.pyx":106 * nonce, * data.encode("UTF-8"), * previous_hash.encode("UTF-8"), # <<<<<<<<<<<<<< @@ -4381,22 +4393,22 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_mstate_global->__pyx_kp_u_UTF_8}; __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 105, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); } - __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error) + __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":106 + /* "dopt_pollublock_blockchain/blockchain.pyx":107 * data.encode("UTF-8"), * previous_hash.encode("UTF-8"), * "".encode("UTF-8"), # <<<<<<<<<<<<<< * ) * if self.BlockC is NULL: */ - __pyx_t_11 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 106, __pyx_L1_error) + __pyx_t_11 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 107, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":100 + /* "dopt_pollublock_blockchain/blockchain.pyx":101 * self.ptr_owner = False * if not from_ptr: * self.BlockC = new Block( # <<<<<<<<<<<<<< @@ -4407,11 +4419,11 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ __pyx_t_12 = new ::Block(__pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_9, __pyx_t_10, __pyx_t_11); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 100, __pyx_L1_error) + __PYX_ERR(0, 101, __pyx_L1_error) } __pyx_v_self->BlockC = __pyx_t_12; - /* "dopt_pollublock_blockchain/blockchain.pyx":108 + /* "dopt_pollublock_blockchain/blockchain.pyx":109 * "".encode("UTF-8"), * ) * if self.BlockC is NULL: # <<<<<<<<<<<<<< @@ -4421,16 +4433,16 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ __pyx_t_2 = (__pyx_v_self->BlockC == NULL); if (unlikely(__pyx_t_2)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":109 + /* "dopt_pollublock_blockchain/blockchain.pyx":110 * ) * if self.BlockC is NULL: * raise MemoryError() # <<<<<<<<<<<<<< * * self.ptr_owner = True */ - PyErr_NoMemory(); __PYX_ERR(0, 109, __pyx_L1_error) + PyErr_NoMemory(); __PYX_ERR(0, 110, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":108 + /* "dopt_pollublock_blockchain/blockchain.pyx":109 * "".encode("UTF-8"), * ) * if self.BlockC is NULL: # <<<<<<<<<<<<<< @@ -4439,7 +4451,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":111 + /* "dopt_pollublock_blockchain/blockchain.pyx":112 * raise MemoryError() * * self.ptr_owner = True # <<<<<<<<<<<<<< @@ -4448,7 +4460,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ */ __pyx_v_self->ptr_owner = 1; - /* "dopt_pollublock_blockchain/blockchain.pyx":99 + /* "dopt_pollublock_blockchain/blockchain.pyx":100 * ): * self.ptr_owner = False * if not from_ptr: # <<<<<<<<<<<<<< @@ -4457,7 +4469,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":91 + /* "dopt_pollublock_blockchain/blockchain.pyx":92 * bint ptr_owner * * def __cinit__(self, # <<<<<<<<<<<<<< @@ -4478,7 +4490,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock___cinit__ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":113 +/* "dopt_pollublock_blockchain/blockchain.pyx":114 * self.ptr_owner = True * * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -4526,7 +4538,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_2__init__ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":116 +/* "dopt_pollublock_blockchain/blockchain.pyx":117 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -4551,7 +4563,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall int __pyx_t_1; int __pyx_t_2; - /* "dopt_pollublock_blockchain/blockchain.pyx":117 + /* "dopt_pollublock_blockchain/blockchain.pyx":118 * * def __dealloc__(self): * if self.BlockC is not NULL and self.ptr_owner is True: # <<<<<<<<<<<<<< @@ -4569,7 +4581,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall __pyx_L4_bool_binop_done:; if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":118 + /* "dopt_pollublock_blockchain/blockchain.pyx":119 * def __dealloc__(self): * if self.BlockC is not NULL and self.ptr_owner is True: * del self.BlockC # <<<<<<<<<<<<<< @@ -4578,7 +4590,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall */ delete __pyx_v_self->BlockC; - /* "dopt_pollublock_blockchain/blockchain.pyx":119 + /* "dopt_pollublock_blockchain/blockchain.pyx":120 * if self.BlockC is not NULL and self.ptr_owner is True: * del self.BlockC * self.BlockC = NULL # <<<<<<<<<<<<<< @@ -4587,7 +4599,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall */ __pyx_v_self->BlockC = NULL; - /* "dopt_pollublock_blockchain/blockchain.pyx":117 + /* "dopt_pollublock_blockchain/blockchain.pyx":118 * * def __dealloc__(self): * if self.BlockC is not NULL and self.ptr_owner is True: # <<<<<<<<<<<<<< @@ -4596,7 +4608,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":116 + /* "dopt_pollublock_blockchain/blockchain.pyx":117 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -4607,7 +4619,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall /* function exit code */ } -/* "dopt_pollublock_blockchain/blockchain.pyx":121 +/* "dopt_pollublock_blockchain/blockchain.pyx":122 * self.BlockC = NULL * * @staticmethod # <<<<<<<<<<<<<< @@ -4617,7 +4629,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4__deall static struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_f_26dopt_pollublock_blockchain_10blockchain_7PyBlock_from_ptr(::Block *__pyx_v_block, struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_7PyBlock_from_ptr *__pyx_optional_args) { - /* "dopt_pollublock_blockchain/blockchain.pyx":122 + /* "dopt_pollublock_blockchain/blockchain.pyx":123 * * @staticmethod * cdef PyBlock from_ptr(Block *block, bint owner=False): # <<<<<<<<<<<<<< @@ -4643,77 +4655,77 @@ static struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx } } - /* "dopt_pollublock_blockchain/blockchain.pyx":125 + /* "dopt_pollublock_blockchain/blockchain.pyx":126 * cdef PyBlock py_block = PyBlock.__new__( * PyBlock, * block.index, # <<<<<<<<<<<<<< * block.nonce, * block.data, */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dopt_pollublock_blockchain/blockchain.pyx":126 + /* "dopt_pollublock_blockchain/blockchain.pyx":127 * PyBlock, * block.index, * block.nonce, # <<<<<<<<<<<<<< * block.data, * block.prev_hash, */ - __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->nonce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "dopt_pollublock_blockchain/blockchain.pyx":127 + /* "dopt_pollublock_blockchain/blockchain.pyx":128 * block.index, * block.nonce, * block.data, # <<<<<<<<<<<<<< * block.prev_hash, * True, */ - __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_block->data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_block->data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "dopt_pollublock_blockchain/blockchain.pyx":128 + /* "dopt_pollublock_blockchain/blockchain.pyx":129 * block.nonce, * block.data, * block.prev_hash, # <<<<<<<<<<<<<< * True, * ) */ - __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_block->prev_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v_block->prev_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "dopt_pollublock_blockchain/blockchain.pyx":123 + /* "dopt_pollublock_blockchain/blockchain.pyx":124 * @staticmethod * cdef PyBlock from_ptr(Block *block, bint owner=False): * cdef PyBlock py_block = PyBlock.__new__( # <<<<<<<<<<<<<< * PyBlock, * block.index, */ - __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 124, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 124, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3) != (0)) __PYX_ERR(0, 124, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 124, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, Py_True) != (0)) __PYX_ERR(0, 123, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 4, Py_True) != (0)) __PYX_ERR(0, 124, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = ((PyObject *)__pyx_tp_new_26dopt_pollublock_blockchain_10blockchain_PyBlock(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock), __pyx_t_5, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_tp_new_26dopt_pollublock_blockchain_10blockchain_PyBlock(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock), __pyx_t_5, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error) __Pyx_GOTREF((PyObject *)__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_py_block = ((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":131 + /* "dopt_pollublock_blockchain/blockchain.pyx":132 * True, * ) * py_block.BlockC = block # <<<<<<<<<<<<<< @@ -4722,7 +4734,7 @@ static struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx */ __pyx_v_py_block->BlockC = __pyx_v_block; - /* "dopt_pollublock_blockchain/blockchain.pyx":132 + /* "dopt_pollublock_blockchain/blockchain.pyx":133 * ) * py_block.BlockC = block * py_block.ptr_owner = owner # <<<<<<<<<<<<<< @@ -4731,7 +4743,7 @@ static struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx */ __pyx_v_py_block->ptr_owner = __pyx_v_owner; - /* "dopt_pollublock_blockchain/blockchain.pyx":134 + /* "dopt_pollublock_blockchain/blockchain.pyx":135 * py_block.ptr_owner = owner * * return py_block # <<<<<<<<<<<<<< @@ -4743,7 +4755,7 @@ static struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx __pyx_r = __pyx_v_py_block; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":121 + /* "dopt_pollublock_blockchain/blockchain.pyx":122 * self.BlockC = NULL * * @staticmethod # <<<<<<<<<<<<<< @@ -4767,12 +4779,12 @@ static struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":136 +/* "dopt_pollublock_blockchain/blockchain.pyx":137 * return py_block * * def __repr__(self): # <<<<<<<<<<<<<< * return ( - * f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" + * f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" */ /* Python wrapper */ @@ -4806,65 +4818,65 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_6__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":137 + /* "dopt_pollublock_blockchain/blockchain.pyx":138 * * def __repr__(self): * return ( # <<<<<<<<<<<<<< - * f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" + * f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" * f"Prev Hash:\t{self.prev_hash}\n\tHash:\t\t{self.hash}\n\tData:\t\t{self.data}\n)" */ __Pyx_XDECREF(__pyx_r); - /* "dopt_pollublock_blockchain/blockchain.pyx":138 + /* "dopt_pollublock_blockchain/blockchain.pyx":139 * def __repr__(self): * return ( - * f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" # <<<<<<<<<<<<<< + * f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" # <<<<<<<<<<<<<< * f"Prev Hash:\t{self.prev_hash}\n\tHash:\t\t{self.hash}\n\tData:\t\t{self.data}\n)" * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":139 + /* "dopt_pollublock_blockchain/blockchain.pyx":140 * return ( - * f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" + * f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" * f"Prev Hash:\t{self.prev_hash}\n\tHash:\t\t{self.hash}\n\tData:\t\t{self.data}\n)" # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prev_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prev_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8[0] = __pyx_mstate_global->__pyx_kp_u_PyBlock_Index; __pyx_t_8[1] = __pyx_t_2; - __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_timestamp_2; + __pyx_t_8[2] = __pyx_mstate_global->__pyx_kp_u_Timestamp; __pyx_t_8[3] = __pyx_t_3; - __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u_nonce_2; + __pyx_t_8[4] = __pyx_mstate_global->__pyx_kp_u_Nonce; __pyx_t_8[5] = __pyx_t_4; __pyx_t_8[6] = __pyx_mstate_global->__pyx_kp_u_Prev_Hash; __pyx_t_8[7] = __pyx_t_5; @@ -4874,15 +4886,15 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_6__ __pyx_t_8[11] = __pyx_t_7; __pyx_t_8[12] = __pyx_mstate_global->__pyx_kp_u__2; - /* "dopt_pollublock_blockchain/blockchain.pyx":138 + /* "dopt_pollublock_blockchain/blockchain.pyx":139 * def __repr__(self): * return ( - * f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" # <<<<<<<<<<<<<< + * f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" # <<<<<<<<<<<<<< * f"Prev Hash:\t{self.prev_hash}\n\tHash:\t\t{self.hash}\n\tData:\t\t{self.data}\n)" * ) */ __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_8, 13, 18 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 13 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 9 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 2, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7)); - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -4894,12 +4906,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_6__ __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":136 + /* "dopt_pollublock_blockchain/blockchain.pyx":137 * return py_block * * def __repr__(self): # <<<<<<<<<<<<<< * return ( - * f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" + * f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" */ /* function exit code */ @@ -4919,7 +4931,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_6__ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":142 +/* "dopt_pollublock_blockchain/blockchain.pyx":143 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -4953,12 +4965,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_8__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":143 + /* "dopt_pollublock_blockchain/blockchain.pyx":144 * * def __str__(self): * return self.__repr__() # <<<<<<<<<<<<<< * - * def serialize_dict(self): + * def as_dataclass(self): */ __Pyx_XDECREF(__pyx_r); __pyx_t_2 = ((PyObject *)__pyx_v_self); @@ -4968,14 +4980,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_8__ PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_repr, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":142 + /* "dopt_pollublock_blockchain/blockchain.pyx":143 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -4995,24 +5007,234 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_8__ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":145 +/* "dopt_pollublock_blockchain/blockchain.pyx":146 * return self.__repr__() * + * def as_dataclass(self): # <<<<<<<<<<<<<< + * return types.PyBlockData( + * Index=self.index, +*/ + +/* Python wrapper */ +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11as_dataclass(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11as_dataclass = {"as_dataclass", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11as_dataclass, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11as_dataclass(PyObject *__pyx_v_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("as_dataclass (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_SIZE + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("as_dataclass", 1, 0, 0, __pyx_nargs); return NULL; } + const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; + if (unlikely(__pyx_kwds_len < 0)) return NULL; + if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("as_dataclass", __pyx_kwds); return NULL;} + __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10as_dataclass(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); + + /* function exit code */ + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10as_dataclass(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + size_t __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("as_dataclass", 0); + + /* "dopt_pollublock_blockchain/blockchain.pyx":147 + * + * def as_dataclass(self): + * return types.PyBlockData( # <<<<<<<<<<<<<< + * Index=self.index, + * Timestamp=self.timestamp, +*/ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_types); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_PyBlockData); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "dopt_pollublock_blockchain/blockchain.pyx":148 + * def as_dataclass(self): + * return types.PyBlockData( + * Index=self.index, # <<<<<<<<<<<<<< + * Timestamp=self.timestamp, + * Nonce=self.nonce, +*/ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + + /* "dopt_pollublock_blockchain/blockchain.pyx":149 + * return types.PyBlockData( + * Index=self.index, + * Timestamp=self.timestamp, # <<<<<<<<<<<<<< + * Nonce=self.nonce, + * PrevHash=self.prev_hash, +*/ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_timestamp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + + /* "dopt_pollublock_blockchain/blockchain.pyx":150 + * Index=self.index, + * Timestamp=self.timestamp, + * Nonce=self.nonce, # <<<<<<<<<<<<<< + * PrevHash=self.prev_hash, + * Hash=self.hash, +*/ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nonce); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + + /* "dopt_pollublock_blockchain/blockchain.pyx":151 + * Timestamp=self.timestamp, + * Nonce=self.nonce, + * PrevHash=self.prev_hash, # <<<<<<<<<<<<<< + * Hash=self.hash, + * Data=self.data, +*/ + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prev_hash); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + + /* "dopt_pollublock_blockchain/blockchain.pyx":152 + * Nonce=self.nonce, + * PrevHash=self.prev_hash, + * Hash=self.hash, # <<<<<<<<<<<<<< + * Data=self.data, + * ) +*/ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + + /* "dopt_pollublock_blockchain/blockchain.pyx":153 + * PrevHash=self.prev_hash, + * Hash=self.hash, + * Data=self.data, # <<<<<<<<<<<<<< + * ) + * +*/ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = 1; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + assert(__pyx_t_2); + PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx__function); + __Pyx_DECREF_SET(__pyx_t_4, __pyx__function); + __pyx_t_10 = 0; + } + #endif + { + PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 6 : 0)] = {__pyx_t_2, NULL}; + __pyx_t_11 = __Pyx_MakeVectorcallBuilderKwds(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_Index, __pyx_t_3, __pyx_t_11, __pyx_callargs+1, 0) < (0)) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_Timestamp_2, __pyx_t_5, __pyx_t_11, __pyx_callargs+1, 1) < (0)) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_Nonce_2, __pyx_t_6, __pyx_t_11, __pyx_callargs+1, 2) < (0)) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_PrevHash, __pyx_t_7, __pyx_t_11, __pyx_callargs+1, 3) < (0)) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_Hash_2, __pyx_t_8, __pyx_t_11, __pyx_callargs+1, 4) < (0)) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_Data_2, __pyx_t_9, __pyx_t_11, __pyx_callargs+1, 5) < (0)) __PYX_ERR(0, 147, __pyx_L1_error) + __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_10, (1-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_11); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "dopt_pollublock_blockchain/blockchain.pyx":146 + * return self.__repr__() + * + * def as_dataclass(self): # <<<<<<<<<<<<<< + * return types.PyBlockData( + * Index=self.index, +*/ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("dopt_pollublock_blockchain.blockchain.PyBlock.as_dataclass", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "dopt_pollublock_blockchain/blockchain.pyx":156 + * ) + * * def serialize_dict(self): # <<<<<<<<<<<<<< * contents = {} * */ /* Python wrapper */ -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11serialize_dict(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13serialize_dict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11serialize_dict = {"serialize_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11serialize_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11serialize_dict(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13serialize_dict = {"serialize_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13serialize_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13serialize_dict(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -5038,14 +5260,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("serialize_dict", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10serialize_dict(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); + __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12serialize_dict(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10serialize_dict(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12serialize_dict(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { PyObject *__pyx_v_contents = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -5055,91 +5277,91 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("serialize_dict", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":146 + /* "dopt_pollublock_blockchain/blockchain.pyx":157 * * def serialize_dict(self): * contents = {} # <<<<<<<<<<<<<< * * contents["index"] = self.BlockC.index */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_contents = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":148 + /* "dopt_pollublock_blockchain/blockchain.pyx":159 * contents = {} * * contents["index"] = self.BlockC.index # <<<<<<<<<<<<<< * contents["timestamp"] = self.BlockC.timestamp * contents["nonce"] = self.BlockC.nonce */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_1) < 0))) __PYX_ERR(0, 148, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_1) < 0))) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":149 + /* "dopt_pollublock_blockchain/blockchain.pyx":160 * * contents["index"] = self.BlockC.index * contents["timestamp"] = self.BlockC.timestamp # <<<<<<<<<<<<<< * contents["nonce"] = self.BlockC.nonce * contents["previous_hash"] = self.prev_hash */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_t_1) < 0))) __PYX_ERR(0, 149, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_t_1) < 0))) __PYX_ERR(0, 160, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":150 + /* "dopt_pollublock_blockchain/blockchain.pyx":161 * contents["index"] = self.BlockC.index * contents["timestamp"] = self.BlockC.timestamp * contents["nonce"] = self.BlockC.nonce # <<<<<<<<<<<<<< * contents["previous_hash"] = self.prev_hash * contents["hash"] = self.hash */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_nonce, __pyx_t_1) < 0))) __PYX_ERR(0, 150, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_nonce, __pyx_t_1) < 0))) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":151 + /* "dopt_pollublock_blockchain/blockchain.pyx":162 * contents["timestamp"] = self.BlockC.timestamp * contents["nonce"] = self.BlockC.nonce * contents["previous_hash"] = self.prev_hash # <<<<<<<<<<<<<< * contents["hash"] = self.hash * contents["data"] = self.data */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prev_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_prev_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_previous_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 151, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_previous_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":152 + /* "dopt_pollublock_blockchain/blockchain.pyx":163 * contents["nonce"] = self.BlockC.nonce * contents["previous_hash"] = self.prev_hash * contents["hash"] = self.hash # <<<<<<<<<<<<<< * contents["data"] = self.data * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 152, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":153 + /* "dopt_pollublock_blockchain/blockchain.pyx":164 * contents["previous_hash"] = self.prev_hash * contents["hash"] = self.hash * contents["data"] = self.data # <<<<<<<<<<<<<< * * return contents */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_1) < 0))) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_1) < 0))) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":155 + /* "dopt_pollublock_blockchain/blockchain.pyx":166 * contents["data"] = self.data * * return contents # <<<<<<<<<<<<<< @@ -5151,8 +5373,8 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10s __pyx_r = __pyx_v_contents; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":145 - * return self.__repr__() + /* "dopt_pollublock_blockchain/blockchain.pyx":156 + * ) * * def serialize_dict(self): # <<<<<<<<<<<<<< * contents = {} @@ -5171,7 +5393,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_10s return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":158 +/* "dopt_pollublock_blockchain/blockchain.pyx":169 * * # Python public API * @property # <<<<<<<<<<<<<< @@ -5203,7 +5425,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5in int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":160 + /* "dopt_pollublock_blockchain/blockchain.pyx":171 * @property * def index(self): * return self.BlockC.index # <<<<<<<<<<<<<< @@ -5211,13 +5433,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5in * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":158 + /* "dopt_pollublock_blockchain/blockchain.pyx":169 * * # Python public API * @property # <<<<<<<<<<<<<< @@ -5236,7 +5458,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5in return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":162 +/* "dopt_pollublock_blockchain/blockchain.pyx":173 * return self.BlockC.index * * @property # <<<<<<<<<<<<<< @@ -5268,7 +5490,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9ti int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":164 + /* "dopt_pollublock_blockchain/blockchain.pyx":175 * @property * def timestamp(self): * return timestamp_to_datetime(self.BlockC.timestamp) # <<<<<<<<<<<<<< @@ -5276,13 +5498,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9ti * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_timestamp_to_datetime(__pyx_v_self->BlockC->timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_timestamp_to_datetime(__pyx_v_self->BlockC->timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 175, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":162 + /* "dopt_pollublock_blockchain/blockchain.pyx":173 * return self.BlockC.index * * @property # <<<<<<<<<<<<<< @@ -5301,7 +5523,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9ti return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":166 +/* "dopt_pollublock_blockchain/blockchain.pyx":177 * return timestamp_to_datetime(self.BlockC.timestamp) * * @property # <<<<<<<<<<<<<< @@ -5333,7 +5555,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4da int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":168 + /* "dopt_pollublock_blockchain/blockchain.pyx":179 * @property * def data(self): * return self.BlockC.data.decode("UTF-8") # <<<<<<<<<<<<<< @@ -5341,13 +5563,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4da * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->BlockC->data, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->BlockC->data, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":166 + /* "dopt_pollublock_blockchain/blockchain.pyx":177 * return timestamp_to_datetime(self.BlockC.timestamp) * * @property # <<<<<<<<<<<<<< @@ -5366,7 +5588,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4da return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":170 +/* "dopt_pollublock_blockchain/blockchain.pyx":181 * return self.BlockC.data.decode("UTF-8") * * @property # <<<<<<<<<<<<<< @@ -5398,7 +5620,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9pr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":172 + /* "dopt_pollublock_blockchain/blockchain.pyx":183 * @property * def prev_hash(self): * return self.BlockC.prev_hash.decode("UTF-8") # <<<<<<<<<<<<<< @@ -5406,13 +5628,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9pr * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->BlockC->prev_hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->BlockC->prev_hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":170 + /* "dopt_pollublock_blockchain/blockchain.pyx":181 * return self.BlockC.data.decode("UTF-8") * * @property # <<<<<<<<<<<<<< @@ -5431,7 +5653,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_9pr return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":174 +/* "dopt_pollublock_blockchain/blockchain.pyx":185 * return self.BlockC.prev_hash.decode("UTF-8") * * @property # <<<<<<<<<<<<<< @@ -5463,7 +5685,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5no int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":176 + /* "dopt_pollublock_blockchain/blockchain.pyx":187 * @property * def nonce(self): * return self.BlockC.nonce # <<<<<<<<<<<<<< @@ -5471,13 +5693,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5no * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->BlockC->nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":174 + /* "dopt_pollublock_blockchain/blockchain.pyx":185 * return self.BlockC.prev_hash.decode("UTF-8") * * @property # <<<<<<<<<<<<<< @@ -5496,7 +5718,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_5no return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":178 +/* "dopt_pollublock_blockchain/blockchain.pyx":189 * return self.BlockC.nonce * * @property # <<<<<<<<<<<<<< @@ -5528,7 +5750,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4ha int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":180 + /* "dopt_pollublock_blockchain/blockchain.pyx":191 * @property * def hash(self): * return self.BlockC.hash.decode("UTF-8") # <<<<<<<<<<<<<< @@ -5536,13 +5758,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4ha * def bytes_serialize(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->BlockC->hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_self->BlockC->hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":178 + /* "dopt_pollublock_blockchain/blockchain.pyx":189 * return self.BlockC.nonce * * @property # <<<<<<<<<<<<<< @@ -5561,7 +5783,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4ha return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":182 +/* "dopt_pollublock_blockchain/blockchain.pyx":193 * return self.BlockC.hash.decode("UTF-8") * * def bytes_serialize(self): # <<<<<<<<<<<<<< @@ -5570,15 +5792,15 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_4ha */ /* Python wrapper */ -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13bytes_serialize(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15bytes_serialize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13bytes_serialize = {"bytes_serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13bytes_serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13bytes_serialize(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15bytes_serialize = {"bytes_serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15bytes_serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15bytes_serialize(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -5604,14 +5826,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("bytes_serialize", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12bytes_serialize(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); + __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14bytes_serialize(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12bytes_serialize(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14bytes_serialize(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { unsigned char *__pyx_v_serialize_res; size_t __pyx_v_serialize_size; PyObject *__pyx_r = NULL; @@ -5632,7 +5854,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12b int __pyx_clineno = 0; __Pyx_RefNannySetupContext("bytes_serialize", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":186 + /* "dopt_pollublock_blockchain/blockchain.pyx":197 * unsigned char *serialize_res * size_t serialize_size * try: # <<<<<<<<<<<<<< @@ -5641,17 +5863,17 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12b */ /*try:*/ { - /* "dopt_pollublock_blockchain/blockchain.pyx":187 + /* "dopt_pollublock_blockchain/blockchain.pyx":198 * size_t serialize_size * try: * serialize_res = bytes_serialize_c(self.BlockC, &serialize_size) # <<<<<<<<<<<<<< * return serialize_res[:serialize_size] * finally: */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_serialize_c(__pyx_v_self->BlockC, (&__pyx_v_serialize_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L4_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_serialize_c(__pyx_v_self->BlockC, (&__pyx_v_serialize_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L4_error) __pyx_v_serialize_res = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":188 + /* "dopt_pollublock_blockchain/blockchain.pyx":199 * try: * serialize_res = bytes_serialize_c(self.BlockC, &serialize_size) * return serialize_res[:serialize_size] # <<<<<<<<<<<<<< @@ -5659,14 +5881,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12b * free(serialize_res) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_serialize_res) + 0, __pyx_v_serialize_size - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L4_error) + __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_serialize_res) + 0, __pyx_v_serialize_size - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L3_return; } - /* "dopt_pollublock_blockchain/blockchain.pyx":190 + /* "dopt_pollublock_blockchain/blockchain.pyx":201 * return serialize_res[:serialize_size] * finally: * free(serialize_res) # <<<<<<<<<<<<<< @@ -5714,7 +5936,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12b } } - /* "dopt_pollublock_blockchain/blockchain.pyx":182 + /* "dopt_pollublock_blockchain/blockchain.pyx":193 * return self.BlockC.hash.decode("UTF-8") * * def bytes_serialize(self): # <<<<<<<<<<<<<< @@ -5733,7 +5955,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12b return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":193 +/* "dopt_pollublock_blockchain/blockchain.pyx":204 * * * def perform_hash(self): # <<<<<<<<<<<<<< @@ -5742,15 +5964,15 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_12b */ /* Python wrapper */ -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15perform_hash(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17perform_hash(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15perform_hash = {"perform_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15perform_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15perform_hash(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17perform_hash = {"perform_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17perform_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17perform_hash(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -5776,14 +5998,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("perform_hash", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14perform_hash(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); + __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16perform_hash(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14perform_hash(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16perform_hash(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { unsigned char *__pyx_v_digest; size_t __pyx_v_digest_size; PyObject *__pyx_r = NULL; @@ -5811,7 +6033,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("perform_hash", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":198 + /* "dopt_pollublock_blockchain/blockchain.pyx":209 * size_t digest_size * * try: # <<<<<<<<<<<<<< @@ -5820,17 +6042,17 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p */ /*try:*/ { - /* "dopt_pollublock_blockchain/blockchain.pyx":199 + /* "dopt_pollublock_blockchain/blockchain.pyx":210 * * try: * digest = perform_hash_c(self.BlockC, &digest_size) # <<<<<<<<<<<<<< * if digest is NULL: * raise MemoryError() */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_hash_c(__pyx_v_self->BlockC, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L4_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_hash_c(__pyx_v_self->BlockC, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L4_error) __pyx_v_digest = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":200 + /* "dopt_pollublock_blockchain/blockchain.pyx":211 * try: * digest = perform_hash_c(self.BlockC, &digest_size) * if digest is NULL: # <<<<<<<<<<<<<< @@ -5840,16 +6062,16 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p __pyx_t_2 = (__pyx_v_digest == NULL); if (unlikely(__pyx_t_2)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":201 + /* "dopt_pollublock_blockchain/blockchain.pyx":212 * digest = perform_hash_c(self.BlockC, &digest_size) * if digest is NULL: * raise MemoryError() # <<<<<<<<<<<<<< * self.BlockC.hash = bytes(digest[:digest_size]).hex().encode("UTF-8") * finally: */ - PyErr_NoMemory(); __PYX_ERR(0, 201, __pyx_L4_error) + PyErr_NoMemory(); __PYX_ERR(0, 212, __pyx_L4_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":200 + /* "dopt_pollublock_blockchain/blockchain.pyx":211 * try: * digest = perform_hash_c(self.BlockC, &digest_size) * if digest is NULL: # <<<<<<<<<<<<<< @@ -5858,7 +6080,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":202 + /* "dopt_pollublock_blockchain/blockchain.pyx":213 * if digest is NULL: * raise MemoryError() * self.BlockC.hash = bytes(digest[:digest_size]).hex().encode("UTF-8") # <<<<<<<<<<<<<< @@ -5866,7 +6088,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p * free(digest) */ __pyx_t_6 = NULL; - __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 202, __pyx_L4_error) + __pyx_t_7 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = 1; { @@ -5874,7 +6096,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p __pyx_t_5 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L4_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); } __pyx_t_4 = __pyx_t_5; @@ -5885,18 +6107,18 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hex, __pyx_callargs+__pyx_t_8, (1-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L4_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_3); } - __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L4_error) + __pyx_t_5 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 202, __pyx_L4_error) + __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L4_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_self->BlockC->hash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9); } - /* "dopt_pollublock_blockchain/blockchain.pyx":204 + /* "dopt_pollublock_blockchain/blockchain.pyx":215 * self.BlockC.hash = bytes(digest[:digest_size]).hex().encode("UTF-8") * finally: * free(digest) # <<<<<<<<<<<<<< @@ -5945,7 +6167,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p __pyx_L5:; } - /* "dopt_pollublock_blockchain/blockchain.pyx":206 + /* "dopt_pollublock_blockchain/blockchain.pyx":217 * free(digest) * * return self.hash # <<<<<<<<<<<<<< @@ -5953,13 +6175,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":193 + /* "dopt_pollublock_blockchain/blockchain.pyx":204 * * * def perform_hash(self): # <<<<<<<<<<<<<< @@ -5989,15 +6211,15 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_14p */ /* Python wrapper */ -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17__reduce_cython__(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17__reduce_cython__(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6023,14 +6245,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; if (unlikely(__pyx_kwds_len < 0)) return NULL; if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;} - __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16__reduce_cython__(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); + __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18__reduce_cython__(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -6070,15 +6292,15 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_16_ */ /* Python wrapper */ -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__setstate_cython__(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_21__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__setstate_cython__(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_21__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_21__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -6144,7 +6366,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18__setstate_cython__(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self), __pyx_v___pyx_state); + __pyx_r = __pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_20__setstate_cython__(((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -6154,7 +6376,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_20__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; @@ -6186,7 +6408,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_7PyBlock_18_ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":209 +/* "dopt_pollublock_blockchain/blockchain.pyx":220 * * * cdef unsigned char* bytes_serialize_c(Block *block, size_t *size) nogil: # <<<<<<<<<<<<<< @@ -6205,7 +6427,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se int __pyx_clineno = 0; PyGILState_STATE __pyx_gilstate_save; - /* "dopt_pollublock_blockchain/blockchain.pyx":213 + /* "dopt_pollublock_blockchain/blockchain.pyx":224 * size_t total_len * unsigned char* buf * size_t pos = 0 # <<<<<<<<<<<<<< @@ -6214,7 +6436,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_pos = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":216 + /* "dopt_pollublock_blockchain/blockchain.pyx":227 * * # index (8), timestamp (8), nonce (8), data, prev_hash * size[0] = ( # <<<<<<<<<<<<<< @@ -6223,7 +6445,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ (__pyx_v_size[0]) = ((((size_t)0x18) + __pyx_v_block->data.size()) + __pyx_v_block->prev_hash.size()); - /* "dopt_pollublock_blockchain/blockchain.pyx":221 + /* "dopt_pollublock_blockchain/blockchain.pyx":232 * block.prev_hash.size() * ) * buf = malloc(size[0] * sizeof(unsigned char)) # <<<<<<<<<<<<<< @@ -6232,7 +6454,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_buf = ((unsigned char *)malloc(((__pyx_v_size[0]) * (sizeof(unsigned char))))); - /* "dopt_pollublock_blockchain/blockchain.pyx":223 + /* "dopt_pollublock_blockchain/blockchain.pyx":234 * buf = malloc(size[0] * sizeof(unsigned char)) * * if buf is NULL: # <<<<<<<<<<<<<< @@ -6242,7 +6464,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se __pyx_t_1 = (__pyx_v_buf == NULL); if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":224 + /* "dopt_pollublock_blockchain/blockchain.pyx":235 * * if buf is NULL: * return NULL # <<<<<<<<<<<<<< @@ -6252,7 +6474,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se __pyx_r = NULL; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":223 + /* "dopt_pollublock_blockchain/blockchain.pyx":234 * buf = malloc(size[0] * sizeof(unsigned char)) * * if buf is NULL: # <<<<<<<<<<<<<< @@ -6261,16 +6483,16 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":226 + /* "dopt_pollublock_blockchain/blockchain.pyx":237 * return NULL * * serialize_uint64(buf + pos, block.index) # <<<<<<<<<<<<<< * pos += 8 * serialize_uint64(buf + pos, block.timestamp) */ - __pyx_t_2 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->index); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->index); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":227 + /* "dopt_pollublock_blockchain/blockchain.pyx":238 * * serialize_uint64(buf + pos, block.index) * pos += 8 # <<<<<<<<<<<<<< @@ -6279,16 +6501,16 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_pos = (__pyx_v_pos + 8); - /* "dopt_pollublock_blockchain/blockchain.pyx":228 + /* "dopt_pollublock_blockchain/blockchain.pyx":239 * serialize_uint64(buf + pos, block.index) * pos += 8 * serialize_uint64(buf + pos, block.timestamp) # <<<<<<<<<<<<<< * pos += 8 * serialize_uint64(buf + pos, block.nonce) */ - __pyx_t_2 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->timestamp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_2 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->timestamp); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 239, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":229 + /* "dopt_pollublock_blockchain/blockchain.pyx":240 * pos += 8 * serialize_uint64(buf + pos, block.timestamp) * pos += 8 # <<<<<<<<<<<<<< @@ -6297,16 +6519,16 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_pos = (__pyx_v_pos + 8); - /* "dopt_pollublock_blockchain/blockchain.pyx":230 + /* "dopt_pollublock_blockchain/blockchain.pyx":241 * serialize_uint64(buf + pos, block.timestamp) * pos += 8 * serialize_uint64(buf + pos, block.nonce) # <<<<<<<<<<<<<< * pos += 8 * # Copy data */ - __pyx_t_2 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->nonce); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_2 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->nonce); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 241, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":231 + /* "dopt_pollublock_blockchain/blockchain.pyx":242 * pos += 8 * serialize_uint64(buf + pos, block.nonce) * pos += 8 # <<<<<<<<<<<<<< @@ -6315,7 +6537,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_pos = (__pyx_v_pos + 8); - /* "dopt_pollublock_blockchain/blockchain.pyx":233 + /* "dopt_pollublock_blockchain/blockchain.pyx":244 * pos += 8 * # Copy data * memcpy( # <<<<<<<<<<<<<< @@ -6324,7 +6546,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ (void)(memcpy((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->data.c_str(), __pyx_v_block->data.size())); - /* "dopt_pollublock_blockchain/blockchain.pyx":238 + /* "dopt_pollublock_blockchain/blockchain.pyx":249 * block.data.size(), * ) * pos += block.data.size() # <<<<<<<<<<<<<< @@ -6333,7 +6555,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_pos = (__pyx_v_pos + __pyx_v_block->data.size()); - /* "dopt_pollublock_blockchain/blockchain.pyx":240 + /* "dopt_pollublock_blockchain/blockchain.pyx":251 * pos += block.data.size() * # Copy prev_hash * memcpy( # <<<<<<<<<<<<<< @@ -6342,7 +6564,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ (void)(memcpy((__pyx_v_buf + __pyx_v_pos), __pyx_v_block->prev_hash.c_str(), __pyx_v_block->prev_hash.size())); - /* "dopt_pollublock_blockchain/blockchain.pyx":245 + /* "dopt_pollublock_blockchain/blockchain.pyx":256 * block.prev_hash.size(), * ) * pos += block.prev_hash.size() # <<<<<<<<<<<<<< @@ -6351,7 +6573,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se */ __pyx_v_pos = (__pyx_v_pos + __pyx_v_block->prev_hash.size()); - /* "dopt_pollublock_blockchain/blockchain.pyx":247 + /* "dopt_pollublock_blockchain/blockchain.pyx":258 * pos += block.prev_hash.size() * * return buf # <<<<<<<<<<<<<< @@ -6361,7 +6583,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se __pyx_r = __pyx_v_buf; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":209 + /* "dopt_pollublock_blockchain/blockchain.pyx":220 * * * cdef unsigned char* bytes_serialize_c(Block *block, size_t *size) nogil: # <<<<<<<<<<<<<< @@ -6379,7 +6601,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_se return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":249 +/* "dopt_pollublock_blockchain/blockchain.pyx":260 * return buf * * cdef unsigned char* SHA256_digest(const void *data, size_t data_size, size_t *digest_size) nogil: # <<<<<<<<<<<<<< @@ -6396,7 +6618,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d unsigned char *__pyx_r; int __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":250 + /* "dopt_pollublock_blockchain/blockchain.pyx":261 * * cdef unsigned char* SHA256_digest(const void *data, size_t data_size, size_t *digest_size) nogil: * cdef ossl.EVP_MD_CTX *ctx = ossl.EVP_MD_CTX_new() # <<<<<<<<<<<<<< @@ -6405,7 +6627,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ __pyx_v_ctx = EVP_MD_CTX_new(); - /* "dopt_pollublock_blockchain/blockchain.pyx":251 + /* "dopt_pollublock_blockchain/blockchain.pyx":262 * cdef unsigned char* SHA256_digest(const void *data, size_t data_size, size_t *digest_size) nogil: * cdef ossl.EVP_MD_CTX *ctx = ossl.EVP_MD_CTX_new() * if ctx is NULL: # <<<<<<<<<<<<<< @@ -6415,7 +6637,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d __pyx_t_1 = (__pyx_v_ctx == NULL); if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":252 + /* "dopt_pollublock_blockchain/blockchain.pyx":263 * cdef ossl.EVP_MD_CTX *ctx = ossl.EVP_MD_CTX_new() * if ctx is NULL: * return NULL # <<<<<<<<<<<<<< @@ -6425,7 +6647,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d __pyx_r = NULL; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":251 + /* "dopt_pollublock_blockchain/blockchain.pyx":262 * cdef unsigned char* SHA256_digest(const void *data, size_t data_size, size_t *digest_size) nogil: * cdef ossl.EVP_MD_CTX *ctx = ossl.EVP_MD_CTX_new() * if ctx is NULL: # <<<<<<<<<<<<<< @@ -6434,7 +6656,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":253 + /* "dopt_pollublock_blockchain/blockchain.pyx":264 * if ctx is NULL: * return NULL * cdef const ossl.EVP_MD *algo = ossl.EVP_sha256() # <<<<<<<<<<<<<< @@ -6443,7 +6665,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ __pyx_v_algo = EVP_sha256(); - /* "dopt_pollublock_blockchain/blockchain.pyx":254 + /* "dopt_pollublock_blockchain/blockchain.pyx":265 * return NULL * cdef const ossl.EVP_MD *algo = ossl.EVP_sha256() * if algo is NULL: # <<<<<<<<<<<<<< @@ -6453,7 +6675,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d __pyx_t_1 = (__pyx_v_algo == NULL); if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":255 + /* "dopt_pollublock_blockchain/blockchain.pyx":266 * cdef const ossl.EVP_MD *algo = ossl.EVP_sha256() * if algo is NULL: * return NULL # <<<<<<<<<<<<<< @@ -6463,7 +6685,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d __pyx_r = NULL; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":254 + /* "dopt_pollublock_blockchain/blockchain.pyx":265 * return NULL * cdef const ossl.EVP_MD *algo = ossl.EVP_sha256() * if algo is NULL: # <<<<<<<<<<<<<< @@ -6472,7 +6694,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":262 + /* "dopt_pollublock_blockchain/blockchain.pyx":273 * unsigned int digest_len * * dig_buff_len = ossl.EVP_MD_size(algo) # <<<<<<<<<<<<<< @@ -6481,7 +6703,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ __pyx_v_dig_buff_len = ((size_t)EVP_MD_size(__pyx_v_algo)); - /* "dopt_pollublock_blockchain/blockchain.pyx":263 + /* "dopt_pollublock_blockchain/blockchain.pyx":274 * * dig_buff_len = ossl.EVP_MD_size(algo) * digest_size[0] = dig_buff_len # <<<<<<<<<<<<<< @@ -6490,7 +6712,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ (__pyx_v_digest_size[0]) = __pyx_v_dig_buff_len; - /* "dopt_pollublock_blockchain/blockchain.pyx":264 + /* "dopt_pollublock_blockchain/blockchain.pyx":275 * dig_buff_len = ossl.EVP_MD_size(algo) * digest_size[0] = dig_buff_len * digest = malloc(dig_buff_len * sizeof(unsigned char)) # <<<<<<<<<<<<<< @@ -6499,7 +6721,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ __pyx_v_digest = ((unsigned char *)malloc((__pyx_v_dig_buff_len * (sizeof(unsigned char))))); - /* "dopt_pollublock_blockchain/blockchain.pyx":265 + /* "dopt_pollublock_blockchain/blockchain.pyx":276 * digest_size[0] = dig_buff_len * digest = malloc(dig_buff_len * sizeof(unsigned char)) * ossl.EVP_DigestInit_ex(ctx, algo, NULL) # <<<<<<<<<<<<<< @@ -6508,7 +6730,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ (void)(EVP_DigestInit_ex(__pyx_v_ctx, __pyx_v_algo, NULL)); - /* "dopt_pollublock_blockchain/blockchain.pyx":266 + /* "dopt_pollublock_blockchain/blockchain.pyx":277 * digest = malloc(dig_buff_len * sizeof(unsigned char)) * ossl.EVP_DigestInit_ex(ctx, algo, NULL) * ossl.EVP_DigestUpdate(ctx, data, data_size) # <<<<<<<<<<<<<< @@ -6517,7 +6739,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ (void)(EVP_DigestUpdate(__pyx_v_ctx, __pyx_v_data, __pyx_v_data_size)); - /* "dopt_pollublock_blockchain/blockchain.pyx":267 + /* "dopt_pollublock_blockchain/blockchain.pyx":278 * ossl.EVP_DigestInit_ex(ctx, algo, NULL) * ossl.EVP_DigestUpdate(ctx, data, data_size) * ossl.EVP_DigestFinal_ex(ctx, digest, &digest_len) # <<<<<<<<<<<<<< @@ -6526,7 +6748,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ (void)(EVP_DigestFinal_ex(__pyx_v_ctx, __pyx_v_digest, (&__pyx_v_digest_len))); - /* "dopt_pollublock_blockchain/blockchain.pyx":269 + /* "dopt_pollublock_blockchain/blockchain.pyx":280 * ossl.EVP_DigestFinal_ex(ctx, digest, &digest_len) * * ossl.EVP_MD_CTX_free(ctx) # <<<<<<<<<<<<<< @@ -6535,7 +6757,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d */ EVP_MD_CTX_free(__pyx_v_ctx); - /* "dopt_pollublock_blockchain/blockchain.pyx":271 + /* "dopt_pollublock_blockchain/blockchain.pyx":282 * ossl.EVP_MD_CTX_free(ctx) * * return digest # <<<<<<<<<<<<<< @@ -6545,7 +6767,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d __pyx_r = __pyx_v_digest; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":249 + /* "dopt_pollublock_blockchain/blockchain.pyx":260 * return buf * * cdef unsigned char* SHA256_digest(const void *data, size_t data_size, size_t *digest_size) nogil: # <<<<<<<<<<<<<< @@ -6558,7 +6780,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_d return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":274 +/* "dopt_pollublock_blockchain/blockchain.pyx":285 * * * cdef unsigned char* perform_hash_c(Block *block, size_t *digest_size) nogil: # <<<<<<<<<<<<<< @@ -6578,17 +6800,17 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ int __pyx_clineno = 0; PyGILState_STATE __pyx_gilstate_save; - /* "dopt_pollublock_blockchain/blockchain.pyx":280 + /* "dopt_pollublock_blockchain/blockchain.pyx":291 * unsigned char *digest * * serialize_res = bytes_serialize_c(block, &serialize_size) # <<<<<<<<<<<<<< * if serialize_res is NULL: * return NULL */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_serialize_c(__pyx_v_block, (&__pyx_v_serialize_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 280, __pyx_L1_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_serialize_c(__pyx_v_block, (&__pyx_v_serialize_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 291, __pyx_L1_error) __pyx_v_serialize_res = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":281 + /* "dopt_pollublock_blockchain/blockchain.pyx":292 * * serialize_res = bytes_serialize_c(block, &serialize_size) * if serialize_res is NULL: # <<<<<<<<<<<<<< @@ -6598,7 +6820,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ __pyx_t_2 = (__pyx_v_serialize_res == NULL); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":282 + /* "dopt_pollublock_blockchain/blockchain.pyx":293 * serialize_res = bytes_serialize_c(block, &serialize_size) * if serialize_res is NULL: * return NULL # <<<<<<<<<<<<<< @@ -6608,7 +6830,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ __pyx_r = NULL; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":281 + /* "dopt_pollublock_blockchain/blockchain.pyx":292 * * serialize_res = bytes_serialize_c(block, &serialize_size) * if serialize_res is NULL: # <<<<<<<<<<<<<< @@ -6617,17 +6839,17 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":283 + /* "dopt_pollublock_blockchain/blockchain.pyx":294 * if serialize_res is NULL: * return NULL * digest = SHA256_digest(serialize_res, serialize_size, digest_size) # <<<<<<<<<<<<<< * free(serialize_res) * if digest is NULL: */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_digest(__pyx_v_serialize_res, __pyx_v_serialize_size, __pyx_v_digest_size); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_digest(__pyx_v_serialize_res, __pyx_v_serialize_size, __pyx_v_digest_size); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 294, __pyx_L1_error) __pyx_v_digest = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":284 + /* "dopt_pollublock_blockchain/blockchain.pyx":295 * return NULL * digest = SHA256_digest(serialize_res, serialize_size, digest_size) * free(serialize_res) # <<<<<<<<<<<<<< @@ -6636,7 +6858,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ */ free(__pyx_v_serialize_res); - /* "dopt_pollublock_blockchain/blockchain.pyx":285 + /* "dopt_pollublock_blockchain/blockchain.pyx":296 * digest = SHA256_digest(serialize_res, serialize_size, digest_size) * free(serialize_res) * if digest is NULL: # <<<<<<<<<<<<<< @@ -6646,7 +6868,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ __pyx_t_2 = (__pyx_v_digest == NULL); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":286 + /* "dopt_pollublock_blockchain/blockchain.pyx":297 * free(serialize_res) * if digest is NULL: * return NULL # <<<<<<<<<<<<<< @@ -6656,7 +6878,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ __pyx_r = NULL; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":285 + /* "dopt_pollublock_blockchain/blockchain.pyx":296 * digest = SHA256_digest(serialize_res, serialize_size, digest_size) * free(serialize_res) * if digest is NULL: # <<<<<<<<<<<<<< @@ -6665,7 +6887,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":288 + /* "dopt_pollublock_blockchain/blockchain.pyx":299 * return NULL * * return digest # <<<<<<<<<<<<<< @@ -6675,7 +6897,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ __pyx_r = __pyx_v_digest; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":274 + /* "dopt_pollublock_blockchain/blockchain.pyx":285 * * * cdef unsigned char* perform_hash_c(Block *block, size_t *digest_size) nogil: # <<<<<<<<<<<<<< @@ -6693,7 +6915,7 @@ static unsigned char *__pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":291 +/* "dopt_pollublock_blockchain/blockchain.pyx":302 * * * cdef int mine_block(Block *block, unsigned int difficulty, uint64_t *nonce_solution, unsigned int max_nonce=0xFFFFFFFF) nogil: # <<<<<<<<<<<<<< @@ -6726,7 +6948,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block } } - /* "dopt_pollublock_blockchain/blockchain.pyx":297 + /* "dopt_pollublock_blockchain/blockchain.pyx":308 * unsigned char *digest * size_t digest_size * bint nonce_found = False # <<<<<<<<<<<<<< @@ -6735,17 +6957,17 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ __pyx_v_nonce_found = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":300 + /* "dopt_pollublock_blockchain/blockchain.pyx":311 * int nonce * * serial_buf = bytes_serialize_c(block, &serialize_size) # <<<<<<<<<<<<<< * * with nogil: */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_serialize_c(__pyx_v_block, (&__pyx_v_serialize_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_bytes_serialize_c(__pyx_v_block, (&__pyx_v_serialize_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 311, __pyx_L1_error) __pyx_v_serial_buf = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":302 + /* "dopt_pollublock_blockchain/blockchain.pyx":313 * serial_buf = bytes_serialize_c(block, &serialize_size) * * with nogil: # <<<<<<<<<<<<<< @@ -6758,7 +6980,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block __Pyx_FastGIL_Remember(); /*try:*/ { - /* "dopt_pollublock_blockchain/blockchain.pyx":303 + /* "dopt_pollublock_blockchain/blockchain.pyx":314 * * with nogil: * for nonce in range(max_nonce): # <<<<<<<<<<<<<< @@ -6770,36 +6992,36 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_nonce = __pyx_t_4; - /* "dopt_pollublock_blockchain/blockchain.pyx":304 + /* "dopt_pollublock_blockchain/blockchain.pyx":315 * with nogil: * for nonce in range(max_nonce): * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) # <<<<<<<<<<<<<< * digest = SHA256_digest(serial_buf, serialize_size, &digest_size) * */ - __pyx_t_5 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_serial_buf + __pyx_v_26dopt_pollublock_blockchain_10blockchain_NONCE_OFFSET), ((uint64_t)__pyx_v_nonce)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 304, __pyx_L4_error) + __pyx_t_5 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_serialize_uint64((__pyx_v_serial_buf + __pyx_v_26dopt_pollublock_blockchain_10blockchain_NONCE_OFFSET), ((uint64_t)__pyx_v_nonce)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 315, __pyx_L4_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":305 + /* "dopt_pollublock_blockchain/blockchain.pyx":316 * for nonce in range(max_nonce): * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) * digest = SHA256_digest(serial_buf, serialize_size, &digest_size) # <<<<<<<<<<<<<< * * if has_leading_zero_bits(digest, difficulty): */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_digest(__pyx_v_serial_buf, __pyx_v_serialize_size, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 305, __pyx_L4_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_digest(__pyx_v_serial_buf, __pyx_v_serialize_size, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_1 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 316, __pyx_L4_error) __pyx_v_digest = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":307 + /* "dopt_pollublock_blockchain/blockchain.pyx":318 * digest = SHA256_digest(serial_buf, serialize_size, &digest_size) * * if has_leading_zero_bits(digest, difficulty): # <<<<<<<<<<<<<< * nonce_found = True * nonce_solution[0] = nonce */ - __pyx_t_6 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_leading_zero_bits(__pyx_v_digest, __pyx_v_difficulty); if (unlikely(__pyx_t_6 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 307, __pyx_L4_error) + __pyx_t_6 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_has_leading_zero_bits(__pyx_v_digest, __pyx_v_difficulty); if (unlikely(__pyx_t_6 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 318, __pyx_L4_error) if (__pyx_t_6) { - /* "dopt_pollublock_blockchain/blockchain.pyx":308 + /* "dopt_pollublock_blockchain/blockchain.pyx":319 * * if has_leading_zero_bits(digest, difficulty): * nonce_found = True # <<<<<<<<<<<<<< @@ -6808,7 +7030,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ __pyx_v_nonce_found = 1; - /* "dopt_pollublock_blockchain/blockchain.pyx":309 + /* "dopt_pollublock_blockchain/blockchain.pyx":320 * if has_leading_zero_bits(digest, difficulty): * nonce_found = True * nonce_solution[0] = nonce # <<<<<<<<<<<<<< @@ -6817,7 +7039,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ (__pyx_v_nonce_solution[0]) = __pyx_v_nonce; - /* "dopt_pollublock_blockchain/blockchain.pyx":310 + /* "dopt_pollublock_blockchain/blockchain.pyx":321 * nonce_found = True * nonce_solution[0] = nonce * break # <<<<<<<<<<<<<< @@ -6826,7 +7048,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ goto __pyx_L7_break; - /* "dopt_pollublock_blockchain/blockchain.pyx":307 + /* "dopt_pollublock_blockchain/blockchain.pyx":318 * digest = SHA256_digest(serial_buf, serialize_size, &digest_size) * * if has_leading_zero_bits(digest, difficulty): # <<<<<<<<<<<<<< @@ -6835,7 +7057,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":312 + /* "dopt_pollublock_blockchain/blockchain.pyx":323 * break * * free(digest) # <<<<<<<<<<<<<< @@ -6847,7 +7069,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block __pyx_L7_break:; } - /* "dopt_pollublock_blockchain/blockchain.pyx":302 + /* "dopt_pollublock_blockchain/blockchain.pyx":313 * serial_buf = bytes_serialize_c(block, &serialize_size) * * with nogil: # <<<<<<<<<<<<<< @@ -6869,7 +7091,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block } } - /* "dopt_pollublock_blockchain/blockchain.pyx":314 + /* "dopt_pollublock_blockchain/blockchain.pyx":325 * free(digest) * * free(serial_buf) # <<<<<<<<<<<<<< @@ -6878,7 +7100,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ free(__pyx_v_serial_buf); - /* "dopt_pollublock_blockchain/blockchain.pyx":316 + /* "dopt_pollublock_blockchain/blockchain.pyx":327 * free(serial_buf) * * if not nonce_found: # <<<<<<<<<<<<<< @@ -6888,7 +7110,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block __pyx_t_6 = (!__pyx_v_nonce_found); if (__pyx_t_6) { - /* "dopt_pollublock_blockchain/blockchain.pyx":317 + /* "dopt_pollublock_blockchain/blockchain.pyx":328 * * if not nonce_found: * return 1 # <<<<<<<<<<<<<< @@ -6898,7 +7120,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block __pyx_r = 1; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":316 + /* "dopt_pollublock_blockchain/blockchain.pyx":327 * free(serial_buf) * * if not nonce_found: # <<<<<<<<<<<<<< @@ -6907,7 +7129,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":319 + /* "dopt_pollublock_blockchain/blockchain.pyx":330 * return 1 * * return 0 # <<<<<<<<<<<<<< @@ -6917,7 +7139,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block __pyx_r = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":291 + /* "dopt_pollublock_blockchain/blockchain.pyx":302 * * * cdef int mine_block(Block *block, unsigned int difficulty, uint64_t *nonce_solution, unsigned int max_nonce=0xFFFFFFFF) nogil: # <<<<<<<<<<<<<< @@ -6935,7 +7157,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(::Block return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":333 +/* "dopt_pollublock_blockchain/blockchain.pyx":344 * readonly object _engine * * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -6989,7 +7211,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":334 + /* "dopt_pollublock_blockchain/blockchain.pyx":345 * * def __cinit__(self, *args, **kwargs): * self._difficulty = 26 # <<<<<<<<<<<<<< @@ -6998,7 +7220,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin */ __pyx_v_self->_difficulty = 26; - /* "dopt_pollublock_blockchain/blockchain.pyx":335 + /* "dopt_pollublock_blockchain/blockchain.pyx":346 * def __cinit__(self, *args, **kwargs): * self._difficulty = 26 * self._index = 0 # <<<<<<<<<<<<<< @@ -7007,7 +7229,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin */ __pyx_v_self->_index = ((uint64_t)0); - /* "dopt_pollublock_blockchain/blockchain.pyx":336 + /* "dopt_pollublock_blockchain/blockchain.pyx":347 * self._difficulty = 26 * self._index = 0 * self._genesis_done = False # <<<<<<<<<<<<<< @@ -7016,7 +7238,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin */ __pyx_v_self->_genesis_done = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":337 + /* "dopt_pollublock_blockchain/blockchain.pyx":348 * self._index = 0 * self._genesis_done = False * self._loaded = False # <<<<<<<<<<<<<< @@ -7025,7 +7247,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin */ __pyx_v_self->_loaded = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":338 + /* "dopt_pollublock_blockchain/blockchain.pyx":349 * self._genesis_done = False * self._loaded = False * self._chain_map = new unordered_map[uint64_t, Block*]() # <<<<<<<<<<<<<< @@ -7036,11 +7258,11 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin __pyx_t_1 = new std::unordered_map (); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 338, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } __pyx_v_self->_chain_map = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":339 + /* "dopt_pollublock_blockchain/blockchain.pyx":350 * self._loaded = False * self._chain_map = new unordered_map[uint64_t, Block*]() * self._chain = new vector[Block*]() # <<<<<<<<<<<<<< @@ -7051,11 +7273,11 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin __pyx_t_2 = new std::vector<::Block *> (); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 339, __pyx_L1_error) + __PYX_ERR(0, 350, __pyx_L1_error) } __pyx_v_self->_chain = __pyx_t_2; - /* "dopt_pollublock_blockchain/blockchain.pyx":340 + /* "dopt_pollublock_blockchain/blockchain.pyx":351 * self._chain_map = new unordered_map[uint64_t, Block*]() * self._chain = new vector[Block*]() * if self._chain_map is NULL: # <<<<<<<<<<<<<< @@ -7065,7 +7287,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin __pyx_t_3 = (__pyx_v_self->_chain_map == NULL); if (unlikely(__pyx_t_3)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":341 + /* "dopt_pollublock_blockchain/blockchain.pyx":352 * self._chain = new vector[Block*]() * if self._chain_map is NULL: * raise MemoryError("Could not allocate hasmap") # <<<<<<<<<<<<<< @@ -7078,14 +7300,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Could_not_allocate_hasmap}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 341, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 341, __pyx_L1_error) + __PYX_ERR(0, 352, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":340 + /* "dopt_pollublock_blockchain/blockchain.pyx":351 * self._chain_map = new unordered_map[uint64_t, Block*]() * self._chain = new vector[Block*]() * if self._chain_map is NULL: # <<<<<<<<<<<<<< @@ -7094,7 +7316,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":342 + /* "dopt_pollublock_blockchain/blockchain.pyx":353 * if self._chain_map is NULL: * raise MemoryError("Could not allocate hasmap") * if self._chain is NULL: # <<<<<<<<<<<<<< @@ -7104,7 +7326,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin __pyx_t_3 = (__pyx_v_self->_chain == NULL); if (unlikely(__pyx_t_3)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":343 + /* "dopt_pollublock_blockchain/blockchain.pyx":354 * raise MemoryError("Could not allocate hasmap") * if self._chain is NULL: * raise MemoryError("Could not allocate vector") # <<<<<<<<<<<<<< @@ -7117,14 +7339,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Could_not_allocate_vector}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 343, __pyx_L1_error) + __PYX_ERR(0, 354, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":342 + /* "dopt_pollublock_blockchain/blockchain.pyx":353 * if self._chain_map is NULL: * raise MemoryError("Could not allocate hasmap") * if self._chain is NULL: # <<<<<<<<<<<<<< @@ -7133,7 +7355,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":333 + /* "dopt_pollublock_blockchain/blockchain.pyx":344 * readonly object _engine * * def __cinit__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -7154,7 +7376,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain___cin return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":345 +/* "dopt_pollublock_blockchain/blockchain.pyx":356 * raise MemoryError("Could not allocate vector") * * def __init__(self, db_path): # <<<<<<<<<<<<<< @@ -7184,32 +7406,32 @@ static int __pyx_pw_26dopt_pollublock_blockchain_10blockchain_10Blockchain_3__in { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_db_path,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 345, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 356, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 356, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 345, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 356, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 345, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 356, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 345, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 356, __pyx_L3_error) } __pyx_v_db_path = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 345, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7246,7 +7468,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":346 + /* "dopt_pollublock_blockchain/blockchain.pyx":357 * * def __init__(self, db_path): * self.db_path = Path(db_path).resolve() # <<<<<<<<<<<<<< @@ -7254,7 +7476,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in * raise FileNotFoundError( */ __pyx_t_4 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = 1; #if CYTHON_UNPACK_METHODS @@ -7273,7 +7495,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_2 = __pyx_t_3; @@ -7284,7 +7506,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_resolve, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); @@ -7293,14 +7515,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __pyx_v_self->db_path = __pyx_t_1; __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":347 + /* "dopt_pollublock_blockchain/blockchain.pyx":358 * def __init__(self, db_path): * self.db_path = Path(db_path).resolve() * if not self.db_path.parent.exists(): # <<<<<<<<<<<<<< * raise FileNotFoundError( * "The parent directory of the provided database path does not exist" */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->db_path, __pyx_mstate_global->__pyx_n_u_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->db_path, __pyx_mstate_global->__pyx_n_u_parent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); @@ -7310,15 +7532,15 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_exists, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = (!__pyx_t_7); if (unlikely(__pyx_t_8)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":348 + /* "dopt_pollublock_blockchain/blockchain.pyx":359 * self.db_path = Path(db_path).resolve() * if not self.db_path.parent.exists(): * raise FileNotFoundError( # <<<<<<<<<<<<<< @@ -7331,14 +7553,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_The_parent_directory_of_the_prov}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_FileNotFoundError)), __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 348, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 348, __pyx_L1_error) + __PYX_ERR(0, 359, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":347 + /* "dopt_pollublock_blockchain/blockchain.pyx":358 * def __init__(self, db_path): * self.db_path = Path(db_path).resolve() * if not self.db_path.parent.exists(): # <<<<<<<<<<<<<< @@ -7347,7 +7569,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":352 + /* "dopt_pollublock_blockchain/blockchain.pyx":363 * ) * * self._engine = sql.create_engine(f"sqlite:///{str(self.db_path)}") # <<<<<<<<<<<<<< @@ -7355,14 +7577,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in * */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_create_engine); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_create_engine); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_self->db_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_v_self->db_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sqlite, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_sqlite, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = 1; @@ -7383,7 +7605,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_GIVEREF(__pyx_t_1); @@ -7392,16 +7614,16 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __pyx_v_self->_engine = __pyx_t_1; __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":353 + /* "dopt_pollublock_blockchain/blockchain.pyx":364 * * self._engine = sql.create_engine(f"sqlite:///{str(self.db_path)}") * db.metadata_blockchain.create_all(self._engine) # <<<<<<<<<<<<<< * * def __dealloc__(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 353, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_blockchain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_metadata_blockchain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = __pyx_t_2; @@ -7412,12 +7634,12 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_create_all, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":345 + /* "dopt_pollublock_blockchain/blockchain.pyx":356 * raise MemoryError("Could not allocate vector") * * def __init__(self, db_path): # <<<<<<<<<<<<<< @@ -7441,7 +7663,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_2__in return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":355 +/* "dopt_pollublock_blockchain/blockchain.pyx":366 * db.metadata_blockchain.create_all(self._engine) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7466,7 +7688,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d std::unordered_map ::iterator __pyx_v_it; int __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":357 + /* "dopt_pollublock_blockchain/blockchain.pyx":368 * def __dealloc__(self): * # ownership is typically not transferred from the Blockchain extension class * cdef BcHashmap.iterator it = self._chain_map.begin() # <<<<<<<<<<<<<< @@ -7475,7 +7697,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ __pyx_v_it = __pyx_v_self->_chain_map->begin(); - /* "dopt_pollublock_blockchain/blockchain.pyx":358 + /* "dopt_pollublock_blockchain/blockchain.pyx":369 * # ownership is typically not transferred from the Blockchain extension class * cdef BcHashmap.iterator it = self._chain_map.begin() * if self._chain_map is not NULL: # <<<<<<<<<<<<<< @@ -7485,7 +7707,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d __pyx_t_1 = (__pyx_v_self->_chain_map != NULL); if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":359 + /* "dopt_pollublock_blockchain/blockchain.pyx":370 * cdef BcHashmap.iterator it = self._chain_map.begin() * if self._chain_map is not NULL: * while it != self._chain_map.end(): # <<<<<<<<<<<<<< @@ -7496,7 +7718,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d __pyx_t_1 = (__pyx_v_it != __pyx_v_self->_chain_map->end()); if (!__pyx_t_1) break; - /* "dopt_pollublock_blockchain/blockchain.pyx":360 + /* "dopt_pollublock_blockchain/blockchain.pyx":371 * if self._chain_map is not NULL: * while it != self._chain_map.end(): * del dereference(it).second # <<<<<<<<<<<<<< @@ -7505,7 +7727,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ delete (*__pyx_v_it).second; - /* "dopt_pollublock_blockchain/blockchain.pyx":361 + /* "dopt_pollublock_blockchain/blockchain.pyx":372 * while it != self._chain_map.end(): * del dereference(it).second * postincrement(it) # <<<<<<<<<<<<<< @@ -7515,7 +7737,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d (void)((__pyx_v_it++)); } - /* "dopt_pollublock_blockchain/blockchain.pyx":363 + /* "dopt_pollublock_blockchain/blockchain.pyx":374 * postincrement(it) * * del self._chain_map # <<<<<<<<<<<<<< @@ -7524,7 +7746,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ delete __pyx_v_self->_chain_map; - /* "dopt_pollublock_blockchain/blockchain.pyx":364 + /* "dopt_pollublock_blockchain/blockchain.pyx":375 * * del self._chain_map * self._chain_map = NULL # <<<<<<<<<<<<<< @@ -7533,7 +7755,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ __pyx_v_self->_chain_map = NULL; - /* "dopt_pollublock_blockchain/blockchain.pyx":358 + /* "dopt_pollublock_blockchain/blockchain.pyx":369 * # ownership is typically not transferred from the Blockchain extension class * cdef BcHashmap.iterator it = self._chain_map.begin() * if self._chain_map is not NULL: # <<<<<<<<<<<<<< @@ -7542,7 +7764,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":366 + /* "dopt_pollublock_blockchain/blockchain.pyx":377 * self._chain_map = NULL * * if self._chain is not NULL: # <<<<<<<<<<<<<< @@ -7552,7 +7774,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d __pyx_t_1 = (__pyx_v_self->_chain != NULL); if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":367 + /* "dopt_pollublock_blockchain/blockchain.pyx":378 * * if self._chain is not NULL: * del self._chain # <<<<<<<<<<<<<< @@ -7561,7 +7783,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ delete __pyx_v_self->_chain; - /* "dopt_pollublock_blockchain/blockchain.pyx":368 + /* "dopt_pollublock_blockchain/blockchain.pyx":379 * if self._chain is not NULL: * del self._chain * self._chain = NULL # <<<<<<<<<<<<<< @@ -7570,7 +7792,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ __pyx_v_self->_chain = NULL; - /* "dopt_pollublock_blockchain/blockchain.pyx":366 + /* "dopt_pollublock_blockchain/blockchain.pyx":377 * self._chain_map = NULL * * if self._chain is not NULL: # <<<<<<<<<<<<<< @@ -7579,7 +7801,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":355 + /* "dopt_pollublock_blockchain/blockchain.pyx":366 * db.metadata_blockchain.create_all(self._engine) * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7590,7 +7812,7 @@ static void __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_4__d /* function exit code */ } -/* "dopt_pollublock_blockchain/blockchain.pyx":370 +/* "dopt_pollublock_blockchain/blockchain.pyx":381 * self._chain = NULL * * cdef Block* get_block_c(self, uint64_t idx) nogil: # <<<<<<<<<<<<<< @@ -7602,7 +7824,7 @@ static ::Block *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_g ::Block *__pyx_r; int __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":371 + /* "dopt_pollublock_blockchain/blockchain.pyx":382 * * cdef Block* get_block_c(self, uint64_t idx) nogil: * if idx > self._index: # <<<<<<<<<<<<<< @@ -7612,7 +7834,7 @@ static ::Block *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_g __pyx_t_1 = (__pyx_v_idx > __pyx_v_self->_index); if (__pyx_t_1) { - /* "dopt_pollublock_blockchain/blockchain.pyx":372 + /* "dopt_pollublock_blockchain/blockchain.pyx":383 * cdef Block* get_block_c(self, uint64_t idx) nogil: * if idx > self._index: * return NULL # <<<<<<<<<<<<<< @@ -7622,7 +7844,7 @@ static ::Block *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_g __pyx_r = NULL; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":371 + /* "dopt_pollublock_blockchain/blockchain.pyx":382 * * cdef Block* get_block_c(self, uint64_t idx) nogil: * if idx > self._index: # <<<<<<<<<<<<<< @@ -7631,7 +7853,7 @@ static ::Block *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_g */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":373 + /* "dopt_pollublock_blockchain/blockchain.pyx":384 * if idx > self._index: * return NULL * return self._chain_map[0][idx] # <<<<<<<<<<<<<< @@ -7641,7 +7863,7 @@ static ::Block *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_g __pyx_r = ((__pyx_v_self->_chain_map[0])[__pyx_v_idx]); goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":370 + /* "dopt_pollublock_blockchain/blockchain.pyx":381 * self._chain = NULL * * cdef Block* get_block_c(self, uint64_t idx) nogil: # <<<<<<<<<<<<<< @@ -7654,7 +7876,7 @@ static ::Block *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_g return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":375 +/* "dopt_pollublock_blockchain/blockchain.pyx":386 * return self._chain_map[0][idx] * * cdef void add_block_from_loading(self, Block *block) nogil: # <<<<<<<<<<<<<< @@ -7670,7 +7892,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b int __pyx_clineno = 0; PyGILState_STATE __pyx_gilstate_save; - /* "dopt_pollublock_blockchain/blockchain.pyx":376 + /* "dopt_pollublock_blockchain/blockchain.pyx":387 * * cdef void add_block_from_loading(self, Block *block) nogil: * self._chain[0].push_back(block) # <<<<<<<<<<<<<< @@ -7683,10 +7905,10 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); __Pyx_CppExn2PyErr(); __Pyx_PyGILState_Release(__pyx_gilstate_save); - __PYX_ERR(0, 376, __pyx_L1_error) + __PYX_ERR(0, 387, __pyx_L1_error) } - /* "dopt_pollublock_blockchain/blockchain.pyx":377 + /* "dopt_pollublock_blockchain/blockchain.pyx":388 * cdef void add_block_from_loading(self, Block *block) nogil: * self._chain[0].push_back(block) * self._chain_map[0][block.index] = block # <<<<<<<<<<<<<< @@ -7695,7 +7917,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b */ ((__pyx_v_self->_chain_map[0])[__pyx_v_block->index]) = __pyx_v_block; - /* "dopt_pollublock_blockchain/blockchain.pyx":378 + /* "dopt_pollublock_blockchain/blockchain.pyx":389 * self._chain[0].push_back(block) * self._chain_map[0][block.index] = block * self._index = block.index # <<<<<<<<<<<<<< @@ -7705,7 +7927,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b __pyx_t_1 = __pyx_v_block->index; __pyx_v_self->_index = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":379 + /* "dopt_pollublock_blockchain/blockchain.pyx":390 * self._chain_map[0][block.index] = block * self._index = block.index * if not self._genesis_done: # <<<<<<<<<<<<<< @@ -7715,7 +7937,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b __pyx_t_2 = (!__pyx_v_self->_genesis_done); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":380 + /* "dopt_pollublock_blockchain/blockchain.pyx":391 * self._index = block.index * if not self._genesis_done: * self._genesis_done = True # <<<<<<<<<<<<<< @@ -7724,7 +7946,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b */ __pyx_v_self->_genesis_done = 1; - /* "dopt_pollublock_blockchain/blockchain.pyx":379 + /* "dopt_pollublock_blockchain/blockchain.pyx":390 * self._chain_map[0][block.index] = block * self._index = block.index * if not self._genesis_done: # <<<<<<<<<<<<<< @@ -7733,7 +7955,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":375 + /* "dopt_pollublock_blockchain/blockchain.pyx":386 * return self._chain_map[0][idx] * * cdef void add_block_from_loading(self, Block *block) nogil: # <<<<<<<<<<<<<< @@ -7750,7 +7972,7 @@ static void __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_b __pyx_L0:; } -/* "dopt_pollublock_blockchain/blockchain.pyx":382 +/* "dopt_pollublock_blockchain/blockchain.pyx":393 * self._genesis_done = True * * cdef int add_block(self, Block *block) nogil: # <<<<<<<<<<<<<< @@ -7780,18 +8002,18 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl PyGILState_STATE __pyx_gilstate_save; __Pyx_RefNannySetupContext("add_block", 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":388 + /* "dopt_pollublock_blockchain/blockchain.pyx":399 * unsigned char *sha256_digest * # mine block * if mine_block(block, self._difficulty, &mined_nonce) != 0: # <<<<<<<<<<<<<< * return 1 * block.nonce = mined_nonce */ - __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(__pyx_v_block, __pyx_v_self->_difficulty, (&__pyx_v_mined_nonce), NULL); if (unlikely(__pyx_t_1 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 388, __pyx_L1_error) + __pyx_t_1 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_mine_block(__pyx_v_block, __pyx_v_self->_difficulty, (&__pyx_v_mined_nonce), NULL); if (unlikely(__pyx_t_1 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 399, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 != 0); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":389 + /* "dopt_pollublock_blockchain/blockchain.pyx":400 * # mine block * if mine_block(block, self._difficulty, &mined_nonce) != 0: * return 1 # <<<<<<<<<<<<<< @@ -7801,7 +8023,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl __pyx_r = 1; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":388 + /* "dopt_pollublock_blockchain/blockchain.pyx":399 * unsigned char *sha256_digest * # mine block * if mine_block(block, self._difficulty, &mined_nonce) != 0: # <<<<<<<<<<<<<< @@ -7810,7 +8032,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":390 + /* "dopt_pollublock_blockchain/blockchain.pyx":401 * if mine_block(block, self._difficulty, &mined_nonce) != 0: * return 1 * block.nonce = mined_nonce # <<<<<<<<<<<<<< @@ -7819,17 +8041,17 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ __pyx_v_block->nonce = __pyx_v_mined_nonce; - /* "dopt_pollublock_blockchain/blockchain.pyx":392 + /* "dopt_pollublock_blockchain/blockchain.pyx":403 * block.nonce = mined_nonce * # hash block, add hash to block, add block to blockchain hashmap * sha256_digest = perform_hash_c(block, &digest_size) # <<<<<<<<<<<<<< * with gil: * block.hash = bytes(sha256_digest[:digest_size]).hex().encode("UTF-8") */ - __pyx_t_3 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_hash_c(__pyx_v_block, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_3 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_3 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_hash_c(__pyx_v_block, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_3 == ((void *)NULL) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 403, __pyx_L1_error) __pyx_v_sha256_digest = __pyx_t_3; - /* "dopt_pollublock_blockchain/blockchain.pyx":393 + /* "dopt_pollublock_blockchain/blockchain.pyx":404 * # hash block, add hash to block, add block to blockchain hashmap * sha256_digest = perform_hash_c(block, &digest_size) * with gil: # <<<<<<<<<<<<<< @@ -7840,7 +8062,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); /*try:*/ { - /* "dopt_pollublock_blockchain/blockchain.pyx":394 + /* "dopt_pollublock_blockchain/blockchain.pyx":405 * sha256_digest = perform_hash_c(block, &digest_size) * with gil: * block.hash = bytes(sha256_digest[:digest_size]).hex().encode("UTF-8") # <<<<<<<<<<<<<< @@ -7848,7 +8070,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl * self._chain[0].push_back(block) */ __pyx_t_7 = NULL; - __pyx_t_8 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_sha256_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 394, __pyx_L5_error) + __pyx_t_8 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_sha256_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = 1; { @@ -7856,7 +8078,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl __pyx_t_6 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L5_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_t_5 = __pyx_t_6; @@ -7867,18 +8089,18 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hex, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L5_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_6 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 394, __pyx_L5_error) + __pyx_t_6 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 405, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 394, __pyx_L5_error) + __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_block->hash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_10); } - /* "dopt_pollublock_blockchain/blockchain.pyx":393 + /* "dopt_pollublock_blockchain/blockchain.pyx":404 * # hash block, add hash to block, add block to blockchain hashmap * sha256_digest = perform_hash_c(block, &digest_size) * with gil: # <<<<<<<<<<<<<< @@ -7898,7 +8120,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl } } - /* "dopt_pollublock_blockchain/blockchain.pyx":395 + /* "dopt_pollublock_blockchain/blockchain.pyx":406 * with gil: * block.hash = bytes(sha256_digest[:digest_size]).hex().encode("UTF-8") * free(sha256_digest) # <<<<<<<<<<<<<< @@ -7907,7 +8129,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ free(__pyx_v_sha256_digest); - /* "dopt_pollublock_blockchain/blockchain.pyx":396 + /* "dopt_pollublock_blockchain/blockchain.pyx":407 * block.hash = bytes(sha256_digest[:digest_size]).hex().encode("UTF-8") * free(sha256_digest) * self._chain[0].push_back(block) # <<<<<<<<<<<<<< @@ -7920,10 +8142,10 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); __Pyx_CppExn2PyErr(); __Pyx_PyGILState_Release(__pyx_gilstate_save); - __PYX_ERR(0, 396, __pyx_L1_error) + __PYX_ERR(0, 407, __pyx_L1_error) } - /* "dopt_pollublock_blockchain/blockchain.pyx":397 + /* "dopt_pollublock_blockchain/blockchain.pyx":408 * free(sha256_digest) * self._chain[0].push_back(block) * self._chain_map[0][block.index] = block # <<<<<<<<<<<<<< @@ -7932,7 +8154,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ ((__pyx_v_self->_chain_map[0])[__pyx_v_block->index]) = __pyx_v_block; - /* "dopt_pollublock_blockchain/blockchain.pyx":399 + /* "dopt_pollublock_blockchain/blockchain.pyx":410 * self._chain_map[0][block.index] = block * * if self._genesis_done: # <<<<<<<<<<<<<< @@ -7941,7 +8163,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ if (__pyx_v_self->_genesis_done) { - /* "dopt_pollublock_blockchain/blockchain.pyx":400 + /* "dopt_pollublock_blockchain/blockchain.pyx":411 * * if self._genesis_done: * self._index += 1 # <<<<<<<<<<<<<< @@ -7950,7 +8172,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ __pyx_v_self->_index = (__pyx_v_self->_index + 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":399 + /* "dopt_pollublock_blockchain/blockchain.pyx":410 * self._chain_map[0][block.index] = block * * if self._genesis_done: # <<<<<<<<<<<<<< @@ -7959,7 +8181,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":402 + /* "dopt_pollublock_blockchain/blockchain.pyx":413 * self._index += 1 * * return 0 # <<<<<<<<<<<<<< @@ -7969,7 +8191,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl __pyx_r = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":382 + /* "dopt_pollublock_blockchain/blockchain.pyx":393 * self._genesis_done = True * * cdef int add_block(self, Block *block) nogil: # <<<<<<<<<<<<<< @@ -7993,7 +8215,7 @@ static int __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_bl return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":404 +/* "dopt_pollublock_blockchain/blockchain.pyx":415 * return 0 * * cdef string hash_data(self, data): # <<<<<<<<<<<<<< @@ -8021,7 +8243,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("hash_data", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":409 + /* "dopt_pollublock_blockchain/blockchain.pyx":420 * unsigned char *data_digest * size_t digest_size * data_str = data.encode("UTF-8") # <<<<<<<<<<<<<< @@ -8035,24 +8257,24 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_UTF_8}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_data_str = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "dopt_pollublock_blockchain/blockchain.pyx":410 + /* "dopt_pollublock_blockchain/blockchain.pyx":421 * size_t digest_size * data_str = data.encode("UTF-8") * data_digest = SHA256_digest(data_str.c_str(), data_str.size(), &digest_size) # <<<<<<<<<<<<<< * if data_digest is NULL: * raise RuntimeError("Failed to hash data") */ - __pyx_t_5 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_digest(__pyx_v_data_str.c_str(), __pyx_v_data_str.size(), (&__pyx_v_digest_size)); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_5 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_SHA256_digest(__pyx_v_data_str.c_str(), __pyx_v_data_str.size(), (&__pyx_v_digest_size)); if (unlikely(__pyx_t_5 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_v_data_digest = __pyx_t_5; - /* "dopt_pollublock_blockchain/blockchain.pyx":411 + /* "dopt_pollublock_blockchain/blockchain.pyx":422 * data_str = data.encode("UTF-8") * data_digest = SHA256_digest(data_str.c_str(), data_str.size(), &digest_size) * if data_digest is NULL: # <<<<<<<<<<<<<< @@ -8062,7 +8284,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai __pyx_t_6 = (__pyx_v_data_digest == NULL); if (unlikely(__pyx_t_6)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":412 + /* "dopt_pollublock_blockchain/blockchain.pyx":423 * data_digest = SHA256_digest(data_str.c_str(), data_str.size(), &digest_size) * if data_digest is NULL: * raise RuntimeError("Failed to hash data") # <<<<<<<<<<<<<< @@ -8075,14 +8297,14 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Failed_to_hash_data}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 412, __pyx_L1_error) + __PYX_ERR(0, 423, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":411 + /* "dopt_pollublock_blockchain/blockchain.pyx":422 * data_str = data.encode("UTF-8") * data_digest = SHA256_digest(data_str.c_str(), data_str.size(), &digest_size) * if data_digest is NULL: # <<<<<<<<<<<<<< @@ -8091,7 +8313,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":413 + /* "dopt_pollublock_blockchain/blockchain.pyx":424 * if data_digest is NULL: * raise RuntimeError("Failed to hash data") * data_str = bytes(data_digest[:digest_size]).hex().encode("UTF-8") # <<<<<<<<<<<<<< @@ -8099,7 +8321,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai * */ __pyx_t_8 = NULL; - __pyx_t_9 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_data_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_data_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = 1; { @@ -8107,7 +8329,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai __pyx_t_7 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } __pyx_t_2 = __pyx_t_7; @@ -8118,17 +8340,17 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hex, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_7 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_7 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_data_str = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "dopt_pollublock_blockchain/blockchain.pyx":414 + /* "dopt_pollublock_blockchain/blockchain.pyx":425 * raise RuntimeError("Failed to hash data") * data_str = bytes(data_digest[:digest_size]).hex().encode("UTF-8") * free(data_digest) # <<<<<<<<<<<<<< @@ -8137,7 +8359,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai */ free(__pyx_v_data_digest); - /* "dopt_pollublock_blockchain/blockchain.pyx":416 + /* "dopt_pollublock_blockchain/blockchain.pyx":427 * free(data_digest) * * return data_str # <<<<<<<<<<<<<< @@ -8147,7 +8369,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai __pyx_r = __pyx_v_data_str; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":404 + /* "dopt_pollublock_blockchain/blockchain.pyx":415 * return 0 * * cdef string hash_data(self, data): # <<<<<<<<<<<<<< @@ -8169,7 +8391,7 @@ static std::string __pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchai return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":418 +/* "dopt_pollublock_blockchain/blockchain.pyx":429 * return data_str * * cdef load_from_batch(self, batch): # <<<<<<<<<<<<<< @@ -8201,7 +8423,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load_from_batch", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":421 + /* "dopt_pollublock_blockchain/blockchain.pyx":432 * cdef Block *block * * for entry in batch: # <<<<<<<<<<<<<< @@ -8213,9 +8435,9 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 421, __pyx_L1_error) + __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -8223,7 +8445,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 432, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -8233,7 +8455,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 432, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } @@ -8244,13 +8466,13 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ #endif ++__pyx_t_2; } - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) } else { __pyx_t_4 = __pyx_t_3(__pyx_t_1); if (unlikely(!__pyx_t_4)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 421, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 432, __pyx_L1_error) PyErr_Clear(); } break; @@ -8260,50 +8482,50 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ __Pyx_XDECREF_SET(__pyx_v_entry, __pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":423 + /* "dopt_pollublock_blockchain/blockchain.pyx":434 * for entry in batch: * block = new Block( * entry[0], # <<<<<<<<<<<<<< * entry[1], * entry[2], */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_5 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":424 + /* "dopt_pollublock_blockchain/blockchain.pyx":435 * block = new Block( * entry[0], * entry[1], # <<<<<<<<<<<<<< * entry[2], * entry[5].encode("UTF-8"), */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":425 + /* "dopt_pollublock_blockchain/blockchain.pyx":436 * entry[0], * entry[1], * entry[2], # <<<<<<<<<<<<<< * entry[5].encode("UTF-8"), * entry[3].encode("UTF-8"), */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_entry, 2, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyLong_As_uint64_t(__pyx_t_4); if (unlikely((__pyx_t_7 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":426 + /* "dopt_pollublock_blockchain/blockchain.pyx":437 * entry[1], * entry[2], * entry[5].encode("UTF-8"), # <<<<<<<<<<<<<< * entry[3].encode("UTF-8"), * entry[4].encode("UTF-8"), */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 5, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); @@ -8313,20 +8535,20 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_11 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_11 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":427 + /* "dopt_pollublock_blockchain/blockchain.pyx":438 * entry[2], * entry[5].encode("UTF-8"), * entry[3].encode("UTF-8"), # <<<<<<<<<<<<<< * entry[4].encode("UTF-8"), * ) */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_entry, 3, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = __pyx_t_8; __Pyx_INCREF(__pyx_t_9); @@ -8336,20 +8558,20 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_12 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_12 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":428 + /* "dopt_pollublock_blockchain/blockchain.pyx":439 * entry[5].encode("UTF-8"), * entry[3].encode("UTF-8"), * entry[4].encode("UTF-8"), # <<<<<<<<<<<<<< * ) * self.add_block_from_loading(block) */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_entry, 4, long, 1, __Pyx_PyLong_From_long, 0, 0, 0, 1, __Pyx_ReferenceSharing_OwnStrongReference); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); @@ -8359,13 +8581,13 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_13 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_13 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 439, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":422 + /* "dopt_pollublock_blockchain/blockchain.pyx":433 * * for entry in batch: * block = new Block( # <<<<<<<<<<<<<< @@ -8376,20 +8598,20 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ __pyx_t_14 = new ::Block(__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_11, __pyx_t_12, __pyx_t_13); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 422, __pyx_L1_error) + __PYX_ERR(0, 433, __pyx_L1_error) } __pyx_v_block = __pyx_t_14; - /* "dopt_pollublock_blockchain/blockchain.pyx":430 + /* "dopt_pollublock_blockchain/blockchain.pyx":441 * entry[4].encode("UTF-8"), * ) * self.add_block_from_loading(block) # <<<<<<<<<<<<<< * * # // Python public API */ - ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block_from_loading(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L1_error) + ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block_from_loading(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 441, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":421 + /* "dopt_pollublock_blockchain/blockchain.pyx":432 * cdef Block *block * * for entry in batch: # <<<<<<<<<<<<<< @@ -8399,7 +8621,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":418 + /* "dopt_pollublock_blockchain/blockchain.pyx":429 * return data_str * * cdef load_from_batch(self, batch): # <<<<<<<<<<<<<< @@ -8424,7 +8646,7 @@ static PyObject *__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_ return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":433 +/* "dopt_pollublock_blockchain/blockchain.pyx":444 * * # // Python public API * def __len__(self): # <<<<<<<<<<<<<< @@ -8457,20 +8679,20 @@ static Py_ssize_t __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchai int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__len__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":434 + /* "dopt_pollublock_blockchain/blockchain.pyx":445 * # // Python public API * def __len__(self): * if self.genesis_done: # <<<<<<<<<<<<<< * return self._index + 1 * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_genesis_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_genesis_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":435 + /* "dopt_pollublock_blockchain/blockchain.pyx":446 * def __len__(self): * if self.genesis_done: * return self._index + 1 # <<<<<<<<<<<<<< @@ -8480,7 +8702,7 @@ static Py_ssize_t __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchai __pyx_r = (__pyx_v_self->_index + 1); goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":434 + /* "dopt_pollublock_blockchain/blockchain.pyx":445 * # // Python public API * def __len__(self): * if self.genesis_done: # <<<<<<<<<<<<<< @@ -8489,7 +8711,7 @@ static Py_ssize_t __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchai */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":437 + /* "dopt_pollublock_blockchain/blockchain.pyx":448 * return self._index + 1 * else: * return 0 # <<<<<<<<<<<<<< @@ -8501,7 +8723,7 @@ static Py_ssize_t __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchai goto __pyx_L0; } - /* "dopt_pollublock_blockchain/blockchain.pyx":433 + /* "dopt_pollublock_blockchain/blockchain.pyx":444 * * # // Python public API * def __len__(self): # <<<<<<<<<<<<<< @@ -8519,7 +8741,7 @@ static Py_ssize_t __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchai return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":439 +/* "dopt_pollublock_blockchain/blockchain.pyx":450 * return 0 * * @property # <<<<<<<<<<<<<< @@ -8551,7 +8773,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":441 + /* "dopt_pollublock_blockchain/blockchain.pyx":452 * @property * def difficulty(self): * return self._difficulty # <<<<<<<<<<<<<< @@ -8559,13 +8781,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * @difficulty.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(__pyx_v_self->_difficulty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(__pyx_v_self->_difficulty); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":439 + /* "dopt_pollublock_blockchain/blockchain.pyx":450 * return 0 * * @property # <<<<<<<<<<<<<< @@ -8584,7 +8806,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":443 +/* "dopt_pollublock_blockchain/blockchain.pyx":454 * return self._difficulty * * @difficulty.setter # <<<<<<<<<<<<<< @@ -8621,7 +8843,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__set__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":445 + /* "dopt_pollublock_blockchain/blockchain.pyx":456 * @difficulty.setter * def difficulty(self, value): * if not isinstance(value, int): # <<<<<<<<<<<<<< @@ -8632,7 +8854,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif __pyx_t_2 = (!__pyx_t_1); if (unlikely(__pyx_t_2)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":446 + /* "dopt_pollublock_blockchain/blockchain.pyx":457 * def difficulty(self, value): * if not isinstance(value, int): * raise TypeError("Difficulty must be integer value") # <<<<<<<<<<<<<< @@ -8645,14 +8867,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Difficulty_must_be_integer_value}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 446, __pyx_L1_error) + __PYX_ERR(0, 457, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":445 + /* "dopt_pollublock_blockchain/blockchain.pyx":456 * @difficulty.setter * def difficulty(self, value): * if not isinstance(value, int): # <<<<<<<<<<<<<< @@ -8661,19 +8883,19 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":447 + /* "dopt_pollublock_blockchain/blockchain.pyx":458 * if not isinstance(value, int): * raise TypeError("Difficulty must be integer value") * if value <= 0: # <<<<<<<<<<<<<< * raise ValueError("Difficulty must be greater than 0") * self._difficulty = value */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_value, __pyx_mstate_global->__pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (unlikely(__pyx_t_2)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":448 + /* "dopt_pollublock_blockchain/blockchain.pyx":459 * raise TypeError("Difficulty must be integer value") * if value <= 0: * raise ValueError("Difficulty must be greater than 0") # <<<<<<<<<<<<<< @@ -8686,14 +8908,14 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Difficulty_must_be_greater_than}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_Raise(__pyx_t_3, 0, 0, 0); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 448, __pyx_L1_error) + __PYX_ERR(0, 459, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":447 + /* "dopt_pollublock_blockchain/blockchain.pyx":458 * if not isinstance(value, int): * raise TypeError("Difficulty must be integer value") * if value <= 0: # <<<<<<<<<<<<<< @@ -8702,17 +8924,17 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":449 + /* "dopt_pollublock_blockchain/blockchain.pyx":460 * if value <= 0: * raise ValueError("Difficulty must be greater than 0") * self._difficulty = value # <<<<<<<<<<<<<< * * @property */ - __pyx_t_6 = __Pyx_PyLong_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error) __pyx_v_self->_difficulty = __pyx_t_6; - /* "dopt_pollublock_blockchain/blockchain.pyx":443 + /* "dopt_pollublock_blockchain/blockchain.pyx":454 * return self._difficulty * * @difficulty.setter # <<<<<<<<<<<<<< @@ -8733,7 +8955,7 @@ static int __pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain_10dif return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":451 +/* "dopt_pollublock_blockchain/blockchain.pyx":462 * self._difficulty = value * * @property # <<<<<<<<<<<<<< @@ -8765,7 +8987,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":453 + /* "dopt_pollublock_blockchain/blockchain.pyx":464 * @property * def genesis_done(self): * return self._genesis_done # <<<<<<<<<<<<<< @@ -8773,13 +8995,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_genesis_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_genesis_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":451 + /* "dopt_pollublock_blockchain/blockchain.pyx":462 * self._difficulty = value * * @property # <<<<<<<<<<<<<< @@ -8798,7 +9020,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":455 +/* "dopt_pollublock_blockchain/blockchain.pyx":466 * return self._genesis_done * * @property # <<<<<<<<<<<<<< @@ -8830,7 +9052,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":457 + /* "dopt_pollublock_blockchain/blockchain.pyx":468 * @property * def index(self): * return self._index # <<<<<<<<<<<<<< @@ -8838,13 +9060,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * def _print_key_value_pair(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":455 + /* "dopt_pollublock_blockchain/blockchain.pyx":466 * return self._genesis_done * * @property # <<<<<<<<<<<<<< @@ -8863,7 +9085,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":459 +/* "dopt_pollublock_blockchain/blockchain.pyx":470 * return self._index * * def _print_key_value_pair(self): # <<<<<<<<<<<<<< @@ -8930,7 +9152,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_print_key_value_pair", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":460 + /* "dopt_pollublock_blockchain/blockchain.pyx":471 * * def _print_key_value_pair(self): * cdef BcHashmap.iterator it = self._chain_map.begin() # <<<<<<<<<<<<<< @@ -8939,7 +9161,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_it = __pyx_v_self->_chain_map->begin(); - /* "dopt_pollublock_blockchain/blockchain.pyx":462 + /* "dopt_pollublock_blockchain/blockchain.pyx":473 * cdef BcHashmap.iterator it = self._chain_map.begin() * cdef Block *block * while it != self._chain_map.end(): # <<<<<<<<<<<<<< @@ -8950,7 +9172,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_1 = (__pyx_v_it != __pyx_v_self->_chain_map->end()); if (!__pyx_t_1) break; - /* "dopt_pollublock_blockchain/blockchain.pyx":463 + /* "dopt_pollublock_blockchain/blockchain.pyx":474 * cdef Block *block * while it != self._chain_map.end(): * print(dereference(it).first) # <<<<<<<<<<<<<< @@ -8958,7 +9180,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * py_block = PyBlock.from_ptr(block) */ __pyx_t_3 = NULL; - __pyx_t_4 = __Pyx_PyLong_From_uint64_t((*__pyx_v_it).first); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_uint64_t((*__pyx_v_it).first); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -8966,12 +9188,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":464 + /* "dopt_pollublock_blockchain/blockchain.pyx":475 * while it != self._chain_map.end(): * print(dereference(it).first) * block = dereference(it).second # <<<<<<<<<<<<<< @@ -8981,19 +9203,19 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_6 = (*__pyx_v_it).second; __pyx_v_block = __pyx_t_6; - /* "dopt_pollublock_blockchain/blockchain.pyx":465 + /* "dopt_pollublock_blockchain/blockchain.pyx":476 * print(dereference(it).first) * block = dereference(it).second * py_block = PyBlock.from_ptr(block) # <<<<<<<<<<<<<< * print(py_block) * postincrement(it) */ - __pyx_t_2 = ((PyObject *)__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock->from_ptr(__pyx_v_block, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock->from_ptr(__pyx_v_block, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_py_block, ((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_t_2)); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":466 + /* "dopt_pollublock_blockchain/blockchain.pyx":477 * block = dereference(it).second * py_block = PyBlock.from_ptr(block) * print(py_block) # <<<<<<<<<<<<<< @@ -9006,12 +9228,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_py_block)}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":467 + /* "dopt_pollublock_blockchain/blockchain.pyx":478 * py_block = PyBlock.from_ptr(block) * print(py_block) * postincrement(it) # <<<<<<<<<<<<<< @@ -9021,7 +9243,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain (void)((__pyx_v_it++)); } - /* "dopt_pollublock_blockchain/blockchain.pyx":459 + /* "dopt_pollublock_blockchain/blockchain.pyx":470 * return self._index * * def _print_key_value_pair(self): # <<<<<<<<<<<<<< @@ -9045,7 +9267,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":469 +/* "dopt_pollublock_blockchain/blockchain.pyx":480 * postincrement(it) * * def print_blocks(self, max_num): # <<<<<<<<<<<<<< @@ -9092,32 +9314,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_max_num,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 469, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 480, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 469, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 480, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "print_blocks", 0) < (0)) __PYX_ERR(0, 469, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "print_blocks", 0) < (0)) __PYX_ERR(0, 480, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("print_blocks", 1, 1, 1, i); __PYX_ERR(0, 469, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("print_blocks", 1, 1, 1, i); __PYX_ERR(0, 480, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 469, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 480, __pyx_L3_error) } __pyx_v_max_num = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("print_blocks", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 469, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("print_blocks", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 480, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9158,17 +9380,17 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("print_blocks", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":472 + /* "dopt_pollublock_blockchain/blockchain.pyx":483 * cdef: * Block *block * int max_nummber = max_num # <<<<<<<<<<<<<< * int idx, num = 0 * */ - __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_max_num); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_As_int(__pyx_v_max_num); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error) __pyx_v_max_nummber = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":473 + /* "dopt_pollublock_blockchain/blockchain.pyx":484 * Block *block * int max_nummber = max_num * int idx, num = 0 # <<<<<<<<<<<<<< @@ -9177,19 +9399,19 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_num = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":475 + /* "dopt_pollublock_blockchain/blockchain.pyx":486 * int idx, num = 0 * * if max_num <= 0: # <<<<<<<<<<<<<< * raise ValueError("Maximum number must be greater than 0") * */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_max_num, __pyx_mstate_global->__pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_max_num, __pyx_mstate_global->__pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (unlikely(__pyx_t_3)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":476 + /* "dopt_pollublock_blockchain/blockchain.pyx":487 * * if max_num <= 0: * raise ValueError("Maximum number must be greater than 0") # <<<<<<<<<<<<<< @@ -9202,14 +9424,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Maximum_number_must_be_greater_t}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_ValueError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 476, __pyx_L1_error) + __PYX_ERR(0, 487, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":475 + /* "dopt_pollublock_blockchain/blockchain.pyx":486 * int idx, num = 0 * * if max_num <= 0: # <<<<<<<<<<<<<< @@ -9218,7 +9440,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":478 + /* "dopt_pollublock_blockchain/blockchain.pyx":489 * raise ValueError("Maximum number must be greater than 0") * * for idx in range(self._chain[0].size()): # <<<<<<<<<<<<<< @@ -9230,7 +9452,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_7; __pyx_t_1+=1) { __pyx_v_idx = __pyx_t_1; - /* "dopt_pollublock_blockchain/blockchain.pyx":479 + /* "dopt_pollublock_blockchain/blockchain.pyx":490 * * for idx in range(self._chain[0].size()): * block = self._chain[0][idx] # <<<<<<<<<<<<<< @@ -9239,19 +9461,19 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_block = ((__pyx_v_self->_chain[0])[__pyx_v_idx]); - /* "dopt_pollublock_blockchain/blockchain.pyx":480 + /* "dopt_pollublock_blockchain/blockchain.pyx":491 * for idx in range(self._chain[0].size()): * block = self._chain[0][idx] * py_block = PyBlock.from_ptr(block) # <<<<<<<<<<<<<< * print(py_block) * num += 1 */ - __pyx_t_2 = ((PyObject *)__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock->from_ptr(__pyx_v_block, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock->from_ptr(__pyx_v_block, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_py_block, ((struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *)__pyx_t_2)); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":481 + /* "dopt_pollublock_blockchain/blockchain.pyx":492 * block = self._chain[0][idx] * py_block = PyBlock.from_ptr(block) * print(py_block) # <<<<<<<<<<<<<< @@ -9264,12 +9486,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_4, ((PyObject *)__pyx_v_py_block)}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":482 + /* "dopt_pollublock_blockchain/blockchain.pyx":493 * py_block = PyBlock.from_ptr(block) * print(py_block) * num += 1 # <<<<<<<<<<<<<< @@ -9278,7 +9500,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_num = (__pyx_v_num + 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":483 + /* "dopt_pollublock_blockchain/blockchain.pyx":494 * print(py_block) * num += 1 * if num == max_nummber: # <<<<<<<<<<<<<< @@ -9288,7 +9510,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_3 = (__pyx_v_num == __pyx_v_max_nummber); if (__pyx_t_3) { - /* "dopt_pollublock_blockchain/blockchain.pyx":484 + /* "dopt_pollublock_blockchain/blockchain.pyx":495 * num += 1 * if num == max_nummber: * break # <<<<<<<<<<<<<< @@ -9297,7 +9519,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ goto __pyx_L5_break; - /* "dopt_pollublock_blockchain/blockchain.pyx":483 + /* "dopt_pollublock_blockchain/blockchain.pyx":494 * print(py_block) * num += 1 * if num == max_nummber: # <<<<<<<<<<<<<< @@ -9308,7 +9530,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain } __pyx_L5_break:; - /* "dopt_pollublock_blockchain/blockchain.pyx":469 + /* "dopt_pollublock_blockchain/blockchain.pyx":480 * postincrement(it) * * def print_blocks(self, max_num): # <<<<<<<<<<<<<< @@ -9331,7 +9553,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":486 +/* "dopt_pollublock_blockchain/blockchain.pyx":497 * break * * def get_block(self, idx): # <<<<<<<<<<<<<< @@ -9378,32 +9600,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_idx,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 486, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 497, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 486, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 497, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_block", 0) < (0)) __PYX_ERR(0, 486, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_block", 0) < (0)) __PYX_ERR(0, 497, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_block", 1, 1, 1, i); __PYX_ERR(0, 486, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_block", 1, 1, 1, i); __PYX_ERR(0, 497, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 486, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 497, __pyx_L3_error) } __pyx_v_idx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 497, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9441,32 +9663,32 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_block", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":487 + /* "dopt_pollublock_blockchain/blockchain.pyx":498 * * def get_block(self, idx): * if idx < 0 or idx > self._index: # <<<<<<<<<<<<<< * raise IndexError("Index value is out of bounds") * */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_idx, __pyx_mstate_global->__pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_3) { } else { __pyx_t_1 = __pyx_t_3; goto __pyx_L4_bool_binop_done; } - __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_idx, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_1 = __pyx_t_3; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_1)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":488 + /* "dopt_pollublock_blockchain/blockchain.pyx":499 * def get_block(self, idx): * if idx < 0 or idx > self._index: * raise IndexError("Index value is out of bounds") # <<<<<<<<<<<<<< @@ -9479,14 +9701,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Index_value_is_out_of_bounds}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 488, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 488, __pyx_L1_error) + __PYX_ERR(0, 499, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":487 + /* "dopt_pollublock_blockchain/blockchain.pyx":498 * * def get_block(self, idx): * if idx < 0 or idx > self._index: # <<<<<<<<<<<<<< @@ -9495,18 +9717,18 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":490 + /* "dopt_pollublock_blockchain/blockchain.pyx":501 * raise IndexError("Index value is out of bounds") * * cdef Block *block = self.get_block_c(idx) # <<<<<<<<<<<<<< * if block is NULL: * raise IndexError("Provided index not found") */ - __pyx_t_6 = __Pyx_PyLong_As_uint64_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L1_error) - __pyx_t_7 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyLong_As_uint64_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 501, __pyx_L1_error) __pyx_v_block = __pyx_t_7; - /* "dopt_pollublock_blockchain/blockchain.pyx":491 + /* "dopt_pollublock_blockchain/blockchain.pyx":502 * * cdef Block *block = self.get_block_c(idx) * if block is NULL: # <<<<<<<<<<<<<< @@ -9516,7 +9738,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_1 = (__pyx_v_block == NULL); if (unlikely(__pyx_t_1)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":492 + /* "dopt_pollublock_blockchain/blockchain.pyx":503 * cdef Block *block = self.get_block_c(idx) * if block is NULL: * raise IndexError("Provided index not found") # <<<<<<<<<<<<<< @@ -9529,14 +9751,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Provided_index_not_found}; __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_IndexError)), __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 492, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 492, __pyx_L1_error) + __PYX_ERR(0, 503, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":491 + /* "dopt_pollublock_blockchain/blockchain.pyx":502 * * cdef Block *block = self.get_block_c(idx) * if block is NULL: # <<<<<<<<<<<<<< @@ -9545,7 +9767,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":493 + /* "dopt_pollublock_blockchain/blockchain.pyx":504 * if block is NULL: * raise IndexError("Provided index not found") * return PyBlock.from_ptr(block, owner=False) # <<<<<<<<<<<<<< @@ -9555,13 +9777,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_r); __pyx_t_8.__pyx_n = 1; __pyx_t_8.owner = 0; - __pyx_t_4 = ((PyObject *)__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock->from_ptr(__pyx_v_block, &__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 493, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock->from_ptr(__pyx_v_block, &__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":486 + /* "dopt_pollublock_blockchain/blockchain.pyx":497 * break * * def get_block(self, idx): # <<<<<<<<<<<<<< @@ -9581,7 +9803,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":495 +/* "dopt_pollublock_blockchain/blockchain.pyx":506 * return PyBlock.from_ptr(block, owner=False) * * def create_genesis_block(self): # <<<<<<<<<<<<<< @@ -9652,7 +9874,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_genesis_block", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":496 + /* "dopt_pollublock_blockchain/blockchain.pyx":507 * * def create_genesis_block(self): * if self._genesis_done: # <<<<<<<<<<<<<< @@ -9661,7 +9883,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ if (unlikely(__pyx_v_self->_genesis_done)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":497 + /* "dopt_pollublock_blockchain/blockchain.pyx":508 * def create_genesis_block(self): * if self._genesis_done: * raise RuntimeError( # <<<<<<<<<<<<<< @@ -9674,14 +9896,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Blockchain_already_has_a_genesis}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 497, __pyx_L1_error) + __PYX_ERR(0, 508, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":496 + /* "dopt_pollublock_blockchain/blockchain.pyx":507 * * def create_genesis_block(self): * if self._genesis_done: # <<<<<<<<<<<<<< @@ -9690,7 +9912,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":502 + /* "dopt_pollublock_blockchain/blockchain.pyx":513 * ) * * genesis_prev_hash = ("0" * 64).encode("UTF-8") # <<<<<<<<<<<<<< @@ -9700,44 +9922,44 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_b_00000000000000000000000000000000); __pyx_v_genesis_prev_hash = __pyx_mstate_global->__pyx_kp_b_00000000000000000000000000000000; - /* "dopt_pollublock_blockchain/blockchain.pyx":503 + /* "dopt_pollublock_blockchain/blockchain.pyx":514 * * genesis_prev_hash = ("0" * 64).encode("UTF-8") * cdef string data_str = self.hash_data("Genesis Block") # <<<<<<<<<<<<<< * * cdef Block *block = new Block( */ - __pyx_t_4 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->hash_data(__pyx_v_self, __pyx_mstate_global->__pyx_kp_u_Genesis_Block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_4 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->hash_data(__pyx_v_self, __pyx_mstate_global->__pyx_kp_u_Genesis_Block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error) __pyx_v_data_str = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4); - /* "dopt_pollublock_blockchain/blockchain.pyx":507 + /* "dopt_pollublock_blockchain/blockchain.pyx":518 * cdef Block *block = new Block( * self._index, * current_timestamp_integer(), # <<<<<<<<<<<<<< * 0, * data_str, */ - __pyx_t_5 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timestamp_integer(); if (unlikely(__pyx_t_5 == ((uint64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_5 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timestamp_integer(); if (unlikely(__pyx_t_5 == ((uint64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 518, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":510 + /* "dopt_pollublock_blockchain/blockchain.pyx":521 * 0, * data_str, * genesis_prev_hash, # <<<<<<<<<<<<<< * "".encode("UTF-8"), * ) */ - __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_genesis_prev_hash); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_4 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_genesis_prev_hash); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 521, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":511 + /* "dopt_pollublock_blockchain/blockchain.pyx":522 * data_str, * genesis_prev_hash, * "".encode("UTF-8"), # <<<<<<<<<<<<<< * ) * cdef int res = self.add_block(block) */ - __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 522, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":505 + /* "dopt_pollublock_blockchain/blockchain.pyx":516 * cdef string data_str = self.hash_data("Genesis Block") * * cdef Block *block = new Block( # <<<<<<<<<<<<<< @@ -9748,21 +9970,21 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_7 = new ::Block(__pyx_v_self->_index, __pyx_t_5, 0, __pyx_v_data_str, __pyx_t_4, __pyx_t_6); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 505, __pyx_L1_error) + __PYX_ERR(0, 516, __pyx_L1_error) } __pyx_v_block = __pyx_t_7; - /* "dopt_pollublock_blockchain/blockchain.pyx":513 + /* "dopt_pollublock_blockchain/blockchain.pyx":524 * "".encode("UTF-8"), * ) * cdef int res = self.add_block(block) # <<<<<<<<<<<<<< * if res != 0: * raise RuntimeError("Could not mine block. No nonce found") */ - __pyx_t_8 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_8 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 524, __pyx_L1_error) __pyx_v_res = __pyx_t_8; - /* "dopt_pollublock_blockchain/blockchain.pyx":514 + /* "dopt_pollublock_blockchain/blockchain.pyx":525 * ) * cdef int res = self.add_block(block) * if res != 0: # <<<<<<<<<<<<<< @@ -9772,7 +9994,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_9 = (__pyx_v_res != 0); if (unlikely(__pyx_t_9)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":515 + /* "dopt_pollublock_blockchain/blockchain.pyx":526 * cdef int res = self.add_block(block) * if res != 0: * raise RuntimeError("Could not mine block. No nonce found") # <<<<<<<<<<<<<< @@ -9785,14 +10007,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Could_not_mine_block_No_nonce_fo}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 515, __pyx_L1_error) + __PYX_ERR(0, 526, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":514 + /* "dopt_pollublock_blockchain/blockchain.pyx":525 * ) * cdef int res = self.add_block(block) * if res != 0: # <<<<<<<<<<<<<< @@ -9801,7 +10023,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":516 + /* "dopt_pollublock_blockchain/blockchain.pyx":527 * if res != 0: * raise RuntimeError("Could not mine block. No nonce found") * self._genesis_done = True # <<<<<<<<<<<<<< @@ -9810,7 +10032,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_self->_genesis_done = 1; - /* "dopt_pollublock_blockchain/blockchain.pyx":495 + /* "dopt_pollublock_blockchain/blockchain.pyx":506 * return PyBlock.from_ptr(block, owner=False) * * def create_genesis_block(self): # <<<<<<<<<<<<<< @@ -9833,7 +10055,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":518 +/* "dopt_pollublock_blockchain/blockchain.pyx":529 * self._genesis_done = True * * def new_block(self, data): # <<<<<<<<<<<<<< @@ -9880,32 +10102,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_data,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 518, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 529, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 529, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "new_block", 0) < (0)) __PYX_ERR(0, 518, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "new_block", 0) < (0)) __PYX_ERR(0, 529, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("new_block", 1, 1, 1, i); __PYX_ERR(0, 518, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("new_block", 1, 1, 1, i); __PYX_ERR(0, 529, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 518, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 529, __pyx_L3_error) } __pyx_v_data = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("new_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 518, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 529, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -9949,7 +10171,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_block", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":527 + /* "dopt_pollublock_blockchain/blockchain.pyx":538 * size_t digest_size * * if not self._genesis_done: # <<<<<<<<<<<<<< @@ -9959,7 +10181,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_1 = (!__pyx_v_self->_genesis_done); if (unlikely(__pyx_t_1)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":528 + /* "dopt_pollublock_blockchain/blockchain.pyx":539 * * if not self._genesis_done: * raise RuntimeError("Create a genesis block first.") # <<<<<<<<<<<<<< @@ -9972,14 +10194,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Create_a_genesis_block_first}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 528, __pyx_L1_error) + __PYX_ERR(0, 539, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":527 + /* "dopt_pollublock_blockchain/blockchain.pyx":538 * size_t digest_size * * if not self._genesis_done: # <<<<<<<<<<<<<< @@ -9988,7 +10210,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":529 + /* "dopt_pollublock_blockchain/blockchain.pyx":540 * if not self._genesis_done: * raise RuntimeError("Create a genesis block first.") * if not isinstance(data, str): # <<<<<<<<<<<<<< @@ -9999,7 +10221,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_5 = (!__pyx_t_1); if (unlikely(__pyx_t_5)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":530 + /* "dopt_pollublock_blockchain/blockchain.pyx":541 * raise RuntimeError("Create a genesis block first.") * if not isinstance(data, str): * raise TypeError("Data must be a string") # <<<<<<<<<<<<<< @@ -10012,14 +10234,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Data_must_be_a_string}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_TypeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 530, __pyx_L1_error) + __PYX_ERR(0, 541, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":529 + /* "dopt_pollublock_blockchain/blockchain.pyx":540 * if not self._genesis_done: * raise RuntimeError("Create a genesis block first.") * if not isinstance(data, str): # <<<<<<<<<<<<<< @@ -10028,27 +10250,27 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":532 + /* "dopt_pollublock_blockchain/blockchain.pyx":543 * raise TypeError("Data must be a string") * * data_str = self.hash_data(data) # <<<<<<<<<<<<<< * prev_block = self.get_block_c(self._index) * prev_hash = prev_block.hash */ - __pyx_t_6 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->hash_data(__pyx_v_self, __pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->hash_data(__pyx_v_self, __pyx_v_data); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L1_error) __pyx_v_data_str = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6); - /* "dopt_pollublock_blockchain/blockchain.pyx":533 + /* "dopt_pollublock_blockchain/blockchain.pyx":544 * * data_str = self.hash_data(data) * prev_block = self.get_block_c(self._index) # <<<<<<<<<<<<<< * prev_hash = prev_block.hash * new_idx = self._index + 1 */ - __pyx_t_7 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_v_self->_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_v_self->_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 544, __pyx_L1_error) __pyx_v_prev_block = __pyx_t_7; - /* "dopt_pollublock_blockchain/blockchain.pyx":534 + /* "dopt_pollublock_blockchain/blockchain.pyx":545 * data_str = self.hash_data(data) * prev_block = self.get_block_c(self._index) * prev_hash = prev_block.hash # <<<<<<<<<<<<<< @@ -10058,7 +10280,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_6 = __pyx_v_prev_block->hash; __pyx_v_prev_hash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6); - /* "dopt_pollublock_blockchain/blockchain.pyx":535 + /* "dopt_pollublock_blockchain/blockchain.pyx":546 * prev_block = self.get_block_c(self._index) * prev_hash = prev_block.hash * new_idx = self._index + 1 # <<<<<<<<<<<<<< @@ -10067,25 +10289,25 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_new_idx = (__pyx_v_self->_index + 1); - /* "dopt_pollublock_blockchain/blockchain.pyx":539 + /* "dopt_pollublock_blockchain/blockchain.pyx":550 * cdef Block *block = new Block( * new_idx, * current_timestamp_integer(), # <<<<<<<<<<<<<< * 0, * data_str, */ - __pyx_t_8 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timestamp_integer(); if (unlikely(__pyx_t_8 == ((uint64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_8 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_current_timestamp_integer(); if (unlikely(__pyx_t_8 == ((uint64_t)-1LL) && PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":543 + /* "dopt_pollublock_blockchain/blockchain.pyx":554 * data_str, * prev_hash, * "".encode("UTF-8"), # <<<<<<<<<<<<<< * ) * cdef int res = self.add_block(block) */ - __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":537 + /* "dopt_pollublock_blockchain/blockchain.pyx":548 * new_idx = self._index + 1 * * cdef Block *block = new Block( # <<<<<<<<<<<<<< @@ -10096,21 +10318,21 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_7 = new ::Block(__pyx_v_new_idx, __pyx_t_8, 0, __pyx_v_data_str, __pyx_v_prev_hash, __pyx_t_6); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 537, __pyx_L1_error) + __PYX_ERR(0, 548, __pyx_L1_error) } __pyx_v_block = __pyx_t_7; - /* "dopt_pollublock_blockchain/blockchain.pyx":545 + /* "dopt_pollublock_blockchain/blockchain.pyx":556 * "".encode("UTF-8"), * ) * cdef int res = self.add_block(block) # <<<<<<<<<<<<<< * if res != 0: * raise RuntimeError("Could not mine block. No nonce found") */ - __pyx_t_9 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_9 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 556, __pyx_L1_error) __pyx_v_res = __pyx_t_9; - /* "dopt_pollublock_blockchain/blockchain.pyx":546 + /* "dopt_pollublock_blockchain/blockchain.pyx":557 * ) * cdef int res = self.add_block(block) * if res != 0: # <<<<<<<<<<<<<< @@ -10120,7 +10342,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_5 = (__pyx_v_res != 0); if (unlikely(__pyx_t_5)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":547 + /* "dopt_pollublock_blockchain/blockchain.pyx":558 * cdef int res = self.add_block(block) * if res != 0: * raise RuntimeError("Could not mine block. No nonce found") # <<<<<<<<<<<<<< @@ -10133,14 +10355,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Could_not_mine_block_No_nonce_fo}; __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_Raise(__pyx_t_2, 0, 0, 0); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __PYX_ERR(0, 547, __pyx_L1_error) + __PYX_ERR(0, 558, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":546 + /* "dopt_pollublock_blockchain/blockchain.pyx":557 * ) * cdef int res = self.add_block(block) * if res != 0: # <<<<<<<<<<<<<< @@ -10149,7 +10371,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":549 + /* "dopt_pollublock_blockchain/blockchain.pyx":560 * raise RuntimeError("Could not mine block. No nonce found") * * return self._index # <<<<<<<<<<<<<< @@ -10157,13 +10379,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * def validate(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":518 + /* "dopt_pollublock_blockchain/blockchain.pyx":529 * self._genesis_done = True * * def new_block(self, data): # <<<<<<<<<<<<<< @@ -10183,7 +10405,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":551 +/* "dopt_pollublock_blockchain/blockchain.pyx":562 * return self._index * * def validate(self): # <<<<<<<<<<<<<< @@ -10259,7 +10481,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("validate", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":554 + /* "dopt_pollublock_blockchain/blockchain.pyx":565 * cdef: * Block *block * Block *prev_block = NULL # <<<<<<<<<<<<<< @@ -10268,7 +10490,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_prev_block = NULL; - /* "dopt_pollublock_blockchain/blockchain.pyx":555 + /* "dopt_pollublock_blockchain/blockchain.pyx":566 * Block *block * Block *prev_block = NULL * int idx = 0 # <<<<<<<<<<<<<< @@ -10277,7 +10499,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_idx = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":559 + /* "dopt_pollublock_blockchain/blockchain.pyx":570 * size_t digest_size * * for idx in range(self._chain[0].size()): # <<<<<<<<<<<<<< @@ -10289,7 +10511,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_idx = __pyx_t_3; - /* "dopt_pollublock_blockchain/blockchain.pyx":560 + /* "dopt_pollublock_blockchain/blockchain.pyx":571 * * for idx in range(self._chain[0].size()): * block = self._chain[0][idx] # <<<<<<<<<<<<<< @@ -10298,7 +10520,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_block = ((__pyx_v_self->_chain[0])[__pyx_v_idx]); - /* "dopt_pollublock_blockchain/blockchain.pyx":561 + /* "dopt_pollublock_blockchain/blockchain.pyx":572 * for idx in range(self._chain[0].size()): * block = self._chain[0][idx] * py_bytes = bytes.fromhex(block.hash.decode("UTF-8")) # <<<<<<<<<<<<<< @@ -10307,7 +10529,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_t_5 = ((PyObject *)(&PyBytes_Type)); __Pyx_INCREF(__pyx_t_5); - __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_v_block->hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_v_block->hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = 0; { @@ -10315,23 +10537,23 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_fromhex, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 561, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_py_bytes, __pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":562 + /* "dopt_pollublock_blockchain/blockchain.pyx":573 * block = self._chain[0][idx] * py_bytes = bytes.fromhex(block.hash.decode("UTF-8")) * digest = perform_hash_c(block, &digest_size) # <<<<<<<<<<<<<< * py_bytes_rehashed = bytes(digest[:digest_size]) * free(digest) */ - __pyx_t_8 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_hash_c(__pyx_v_block, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_8 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = __pyx_f_26dopt_pollublock_blockchain_10blockchain_perform_hash_c(__pyx_v_block, (&__pyx_v_digest_size)); if (unlikely(__pyx_t_8 == ((void *)NULL) && PyErr_Occurred())) __PYX_ERR(0, 573, __pyx_L1_error) __pyx_v_digest = __pyx_t_8; - /* "dopt_pollublock_blockchain/blockchain.pyx":563 + /* "dopt_pollublock_blockchain/blockchain.pyx":574 * py_bytes = bytes.fromhex(block.hash.decode("UTF-8")) * digest = perform_hash_c(block, &digest_size) * py_bytes_rehashed = bytes(digest[:digest_size]) # <<<<<<<<<<<<<< @@ -10339,7 +10561,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * if py_bytes != py_bytes_rehashed: */ __pyx_t_6 = NULL; - __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = 1; { @@ -10347,13 +10569,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_XDECREF_SET(__pyx_v_py_bytes_rehashed, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":564 + /* "dopt_pollublock_blockchain/blockchain.pyx":575 * digest = perform_hash_c(block, &digest_size) * py_bytes_rehashed = bytes(digest[:digest_size]) * free(digest) # <<<<<<<<<<<<<< @@ -10362,17 +10584,17 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ free(__pyx_v_digest); - /* "dopt_pollublock_blockchain/blockchain.pyx":565 + /* "dopt_pollublock_blockchain/blockchain.pyx":576 * py_bytes_rehashed = bytes(digest[:digest_size]) * free(digest) * if py_bytes != py_bytes_rehashed: # <<<<<<<<<<<<<< * print(f"Index {idx}: Hashes to not match. Abort.") * return False */ - __pyx_t_9 = (__Pyx_PyBytes_Equals(__pyx_v_py_bytes, __pyx_v_py_bytes_rehashed, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_9 = (__Pyx_PyBytes_Equals(__pyx_v_py_bytes, __pyx_v_py_bytes_rehashed, Py_NE)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) if (__pyx_t_9) { - /* "dopt_pollublock_blockchain/blockchain.pyx":566 + /* "dopt_pollublock_blockchain/blockchain.pyx":577 * free(digest) * if py_bytes != py_bytes_rehashed: * print(f"Index {idx}: Hashes to not match. Abort.") # <<<<<<<<<<<<<< @@ -10380,13 +10602,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * if prev_block is not NULL: */ __pyx_t_5 = NULL; - __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Index; + __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Index_2; __pyx_t_10[1] = __pyx_t_6; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_Hashes_to_not_match_Abort; __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 29, 127); - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_7 = 1; @@ -10395,12 +10617,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":567 + /* "dopt_pollublock_blockchain/blockchain.pyx":578 * if py_bytes != py_bytes_rehashed: * print(f"Index {idx}: Hashes to not match. Abort.") * return False # <<<<<<<<<<<<<< @@ -10412,7 +10634,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_r = Py_False; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":565 + /* "dopt_pollublock_blockchain/blockchain.pyx":576 * py_bytes_rehashed = bytes(digest[:digest_size]) * free(digest) * if py_bytes != py_bytes_rehashed: # <<<<<<<<<<<<<< @@ -10421,7 +10643,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":568 + /* "dopt_pollublock_blockchain/blockchain.pyx":579 * print(f"Index {idx}: Hashes to not match. Abort.") * return False * if prev_block is not NULL: # <<<<<<<<<<<<<< @@ -10431,7 +10653,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_9 = (__pyx_v_prev_block != NULL); if (__pyx_t_9) { - /* "dopt_pollublock_blockchain/blockchain.pyx":569 + /* "dopt_pollublock_blockchain/blockchain.pyx":580 * return False * if prev_block is not NULL: * if prev_block.hash != block.prev_hash: # <<<<<<<<<<<<<< @@ -10441,7 +10663,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_9 = (__pyx_v_prev_block->hash != __pyx_v_block->prev_hash); if (__pyx_t_9) { - /* "dopt_pollublock_blockchain/blockchain.pyx":570 + /* "dopt_pollublock_blockchain/blockchain.pyx":581 * if prev_block is not NULL: * if prev_block.hash != block.prev_hash: * print( # <<<<<<<<<<<<<< @@ -10450,20 +10672,20 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_t_11 = NULL; - /* "dopt_pollublock_blockchain/blockchain.pyx":571 + /* "dopt_pollublock_blockchain/blockchain.pyx":582 * if prev_block.hash != block.prev_hash: * print( * (f"Index {idx}: Hash mismatch. Hash of previous block does not " # <<<<<<<<<<<<<< * "match the saved one in the current block. Abort.") * ) */ - __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_idx, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Index; + __pyx_t_10[0] = __pyx_mstate_global->__pyx_kp_u_Index_2; __pyx_t_10[1] = __pyx_t_5; __pyx_t_10[2] = __pyx_mstate_global->__pyx_kp_u_Hash_mismatch_Hash_of_previous; __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_10, 3, 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 97, 127); - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_7 = 1; @@ -10472,12 +10694,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_builtin_print, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":574 + /* "dopt_pollublock_blockchain/blockchain.pyx":585 * "match the saved one in the current block. Abort.") * ) * return False # <<<<<<<<<<<<<< @@ -10489,7 +10711,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_r = Py_False; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":569 + /* "dopt_pollublock_blockchain/blockchain.pyx":580 * return False * if prev_block is not NULL: * if prev_block.hash != block.prev_hash: # <<<<<<<<<<<<<< @@ -10498,7 +10720,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":568 + /* "dopt_pollublock_blockchain/blockchain.pyx":579 * print(f"Index {idx}: Hashes to not match. Abort.") * return False * if prev_block is not NULL: # <<<<<<<<<<<<<< @@ -10507,7 +10729,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":575 + /* "dopt_pollublock_blockchain/blockchain.pyx":586 * ) * return False * prev_block = block # <<<<<<<<<<<<<< @@ -10517,7 +10739,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_v_prev_block = __pyx_v_block; } - /* "dopt_pollublock_blockchain/blockchain.pyx":577 + /* "dopt_pollublock_blockchain/blockchain.pyx":588 * prev_block = block * * return True # <<<<<<<<<<<<<< @@ -10529,7 +10751,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_r = Py_True; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":551 + /* "dopt_pollublock_blockchain/blockchain.pyx":562 * return self._index * * def validate(self): # <<<<<<<<<<<<<< @@ -10553,7 +10775,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":579 +/* "dopt_pollublock_blockchain/blockchain.pyx":590 * return True * * def get_saving_entries(self, min_idx): # <<<<<<<<<<<<<< @@ -10600,32 +10822,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_min_idx,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 579, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 590, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 590, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_saving_entries", 0) < (0)) __PYX_ERR(0, 579, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_saving_entries", 0) < (0)) __PYX_ERR(0, 590, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_saving_entries", 1, 1, 1, i); __PYX_ERR(0, 579, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_saving_entries", 1, 1, 1, i); __PYX_ERR(0, 590, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 590, __pyx_L3_error) } __pyx_v_min_idx = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("get_saving_entries", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 579, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_saving_entries", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 590, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10665,19 +10887,19 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_saving_entries", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":580 + /* "dopt_pollublock_blockchain/blockchain.pyx":591 * * def get_saving_entries(self, min_idx): * entries = [] # <<<<<<<<<<<<<< * cdef: * Block *block */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_entries = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":583 + /* "dopt_pollublock_blockchain/blockchain.pyx":594 * cdef: * Block *block * int idx = 0 # <<<<<<<<<<<<<< @@ -10686,7 +10908,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_idx = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":586 + /* "dopt_pollublock_blockchain/blockchain.pyx":597 * int _min_idx * * if min_idx is None: # <<<<<<<<<<<<<< @@ -10696,7 +10918,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_2 = (__pyx_v_min_idx == Py_None); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":587 + /* "dopt_pollublock_blockchain/blockchain.pyx":598 * * if min_idx is None: * _min_idx = -1 # <<<<<<<<<<<<<< @@ -10705,7 +10927,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v__min_idx = -1; - /* "dopt_pollublock_blockchain/blockchain.pyx":586 + /* "dopt_pollublock_blockchain/blockchain.pyx":597 * int _min_idx * * if min_idx is None: # <<<<<<<<<<<<<< @@ -10715,7 +10937,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain goto __pyx_L3; } - /* "dopt_pollublock_blockchain/blockchain.pyx":589 + /* "dopt_pollublock_blockchain/blockchain.pyx":600 * _min_idx = -1 * else: * _min_idx = min_idx # <<<<<<<<<<<<<< @@ -10723,12 +10945,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * for idx in range(self._chain[0].size()): */ /*else*/ { - __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_min_idx); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_v_min_idx); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 600, __pyx_L1_error) __pyx_v__min_idx = __pyx_t_3; } __pyx_L3:; - /* "dopt_pollublock_blockchain/blockchain.pyx":591 + /* "dopt_pollublock_blockchain/blockchain.pyx":602 * _min_idx = min_idx * * for idx in range(self._chain[0].size()): # <<<<<<<<<<<<<< @@ -10740,7 +10962,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) { __pyx_v_idx = __pyx_t_3; - /* "dopt_pollublock_blockchain/blockchain.pyx":592 + /* "dopt_pollublock_blockchain/blockchain.pyx":603 * * for idx in range(self._chain[0].size()): * if idx <= _min_idx: # <<<<<<<<<<<<<< @@ -10750,7 +10972,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_2 = (__pyx_v_idx <= __pyx_v__min_idx); if (__pyx_t_2) { - /* "dopt_pollublock_blockchain/blockchain.pyx":593 + /* "dopt_pollublock_blockchain/blockchain.pyx":604 * for idx in range(self._chain[0].size()): * if idx <= _min_idx: * continue # <<<<<<<<<<<<<< @@ -10759,7 +10981,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ goto __pyx_L4_continue; - /* "dopt_pollublock_blockchain/blockchain.pyx":592 + /* "dopt_pollublock_blockchain/blockchain.pyx":603 * * for idx in range(self._chain[0].size()): * if idx <= _min_idx: # <<<<<<<<<<<<<< @@ -10768,7 +10990,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":594 + /* "dopt_pollublock_blockchain/blockchain.pyx":605 * if idx <= _min_idx: * continue * block = self._chain[0][idx] # <<<<<<<<<<<<<< @@ -10777,102 +10999,102 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_v_block = ((__pyx_v_self->_chain[0])[__pyx_v_idx]); - /* "dopt_pollublock_blockchain/blockchain.pyx":595 + /* "dopt_pollublock_blockchain/blockchain.pyx":606 * continue * block = self._chain[0][idx] * contents = {} # <<<<<<<<<<<<<< * contents["index"] = block.index * contents["timestamp"] = block.timestamp */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_contents, ((PyObject*)__pyx_t_1)); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":596 + /* "dopt_pollublock_blockchain/blockchain.pyx":607 * block = self._chain[0][idx] * contents = {} * contents["index"] = block.index # <<<<<<<<<<<<<< * contents["timestamp"] = block.timestamp * contents["nonce"] = block.nonce */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_1) < 0))) __PYX_ERR(0, 596, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_index, __pyx_t_1) < 0))) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":597 + /* "dopt_pollublock_blockchain/blockchain.pyx":608 * contents = {} * contents["index"] = block.index * contents["timestamp"] = block.timestamp # <<<<<<<<<<<<<< * contents["nonce"] = block.nonce * contents["previous_hash"] = block.prev_hash.decode("UTF-8") */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->timestamp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_t_1) < 0))) __PYX_ERR(0, 597, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_timestamp, __pyx_t_1) < 0))) __PYX_ERR(0, 608, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":598 + /* "dopt_pollublock_blockchain/blockchain.pyx":609 * contents["index"] = block.index * contents["timestamp"] = block.timestamp * contents["nonce"] = block.nonce # <<<<<<<<<<<<<< * contents["previous_hash"] = block.prev_hash.decode("UTF-8") * contents["hash"] = block.hash.decode("UTF-8") */ - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_block->nonce); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_nonce, __pyx_t_1) < 0))) __PYX_ERR(0, 598, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_nonce, __pyx_t_1) < 0))) __PYX_ERR(0, 609, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":599 + /* "dopt_pollublock_blockchain/blockchain.pyx":610 * contents["timestamp"] = block.timestamp * contents["nonce"] = block.nonce * contents["previous_hash"] = block.prev_hash.decode("UTF-8") # <<<<<<<<<<<<<< * contents["hash"] = block.hash.decode("UTF-8") * contents["data"] = block.data.decode("UTF-8") */ - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_block->prev_hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_block->prev_hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_previous_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 599, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_previous_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 610, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":600 + /* "dopt_pollublock_blockchain/blockchain.pyx":611 * contents["nonce"] = block.nonce * contents["previous_hash"] = block.prev_hash.decode("UTF-8") * contents["hash"] = block.hash.decode("UTF-8") # <<<<<<<<<<<<<< * contents["data"] = block.data.decode("UTF-8") * entries.append(contents) */ - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_block->hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_block->hash, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 600, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_hash, __pyx_t_1) < 0))) __PYX_ERR(0, 611, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":601 + /* "dopt_pollublock_blockchain/blockchain.pyx":612 * contents["previous_hash"] = block.prev_hash.decode("UTF-8") * contents["hash"] = block.hash.decode("UTF-8") * contents["data"] = block.data.decode("UTF-8") # <<<<<<<<<<<<<< * entries.append(contents) * */ - __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_block->data, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_1 = __Pyx_decode_cpp_string(__pyx_v_block->data, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_1) < 0))) __PYX_ERR(0, 601, __pyx_L1_error) + if (unlikely((PyDict_SetItem(__pyx_v_contents, __pyx_mstate_global->__pyx_n_u_data, __pyx_t_1) < 0))) __PYX_ERR(0, 612, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":602 + /* "dopt_pollublock_blockchain/blockchain.pyx":613 * contents["hash"] = block.hash.decode("UTF-8") * contents["data"] = block.data.decode("UTF-8") * entries.append(contents) # <<<<<<<<<<<<<< * * return entries */ - __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_contents); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_entries, __pyx_v_contents); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 613, __pyx_L1_error) __pyx_L4_continue:; } - /* "dopt_pollublock_blockchain/blockchain.pyx":604 + /* "dopt_pollublock_blockchain/blockchain.pyx":615 * entries.append(contents) * * return entries # <<<<<<<<<<<<<< @@ -10884,7 +11106,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_r = __pyx_v_entries; goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":579 + /* "dopt_pollublock_blockchain/blockchain.pyx":590 * return True * * def get_saving_entries(self, min_idx): # <<<<<<<<<<<<<< @@ -10905,7 +11127,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":606 +/* "dopt_pollublock_blockchain/blockchain.pyx":617 * return entries * * def save(self): # <<<<<<<<<<<<<< @@ -10985,7 +11207,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("save", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":609 + /* "dopt_pollublock_blockchain/blockchain.pyx":620 * # get max index from db * # only retrieve indices greater than max value * stmt = sql.select(sql.func.max(db.blocks.c.index)) # <<<<<<<<<<<<<< @@ -10993,27 +11215,27 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain * result = conn.execute(stmt) */ __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_select); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_select); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_func); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_func); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_5 = __pyx_t_7; __Pyx_INCREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_c); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_c); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_9 = 0; @@ -11023,7 +11245,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 609, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); } __pyx_t_9 = 1; @@ -11044,13 +11266,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_v_stmt = __pyx_t_1; __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":610 + /* "dopt_pollublock_blockchain/blockchain.pyx":621 * # only retrieve indices greater than max value * stmt = sql.select(sql.func.max(db.blocks.c.index)) * with self._engine.connect() as conn: # <<<<<<<<<<<<<< @@ -11065,13 +11287,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_connect, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_3 = NULL; - __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L3_error) + __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -11090,7 +11312,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_2, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 610, __pyx_L3_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 621, __pyx_L3_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __pyx_t_4; @@ -11108,7 +11330,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_v_conn = __pyx_t_2; __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":611 + /* "dopt_pollublock_blockchain/blockchain.pyx":622 * stmt = sql.select(sql.func.max(db.blocks.c.index)) * with self._engine.connect() as conn: * result = conn.execute(stmt) # <<<<<<<<<<<<<< @@ -11122,13 +11344,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_stmt}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_execute, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L7_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_result = __pyx_t_2; __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":612 + /* "dopt_pollublock_blockchain/blockchain.pyx":623 * with self._engine.connect() as conn: * result = conn.execute(stmt) * max_value = result.scalar() # <<<<<<<<<<<<<< @@ -11142,13 +11364,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_scalar, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L7_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_v_max_value = __pyx_t_2; __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":610 + /* "dopt_pollublock_blockchain/blockchain.pyx":621 * # only retrieve indices greater than max value * stmt = sql.select(sql.func.max(db.blocks.c.index)) * with self._engine.connect() as conn: # <<<<<<<<<<<<<< @@ -11171,20 +11393,20 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /*except:*/ { __Pyx_AddTraceback("dopt_pollublock_blockchain.blockchain.Blockchain.save", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 610, __pyx_L9_except_error) + if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 621, __pyx_L9_except_error) __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L9_except_error) + __pyx_t_3 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 621, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_3, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 610, __pyx_L9_except_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 621, __pyx_L9_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_15 < (0)) __PYX_ERR(0, 610, __pyx_L9_except_error) + if (__pyx_t_15 < (0)) __PYX_ERR(0, 621, __pyx_L9_except_error) __pyx_t_16 = (!__pyx_t_15); if (unlikely(__pyx_t_16)) { __Pyx_GIVEREF(__pyx_t_2); @@ -11192,7 +11414,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_4); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; - __PYX_ERR(0, 610, __pyx_L9_except_error) + __PYX_ERR(0, 621, __pyx_L9_except_error) } __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11218,7 +11440,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain if (__pyx_t_10) { __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 610, __pyx_L1_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } @@ -11233,7 +11455,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_L16:; } - /* "dopt_pollublock_blockchain/blockchain.pyx":614 + /* "dopt_pollublock_blockchain/blockchain.pyx":625 * max_value = result.scalar() * * entries = self.get_saving_entries(max_value) # <<<<<<<<<<<<<< @@ -11242,30 +11464,30 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ __pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); - if (unlikely(!__pyx_v_max_value)) { __Pyx_RaiseUnboundLocalError("max_value"); __PYX_ERR(0, 614, __pyx_L1_error) } + if (unlikely(!__pyx_v_max_value)) { __Pyx_RaiseUnboundLocalError("max_value"); __PYX_ERR(0, 625, __pyx_L1_error) } __pyx_t_9 = 0; { PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_max_value}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_get_saving_entries, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_v_entries = __pyx_t_4; __pyx_t_4 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":615 + /* "dopt_pollublock_blockchain/blockchain.pyx":626 * * entries = self.get_saving_entries(max_value) * if not entries: # <<<<<<<<<<<<<< * return * */ - __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_entries); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 615, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_entries); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 626, __pyx_L1_error) __pyx_t_15 = (!__pyx_t_16); if (__pyx_t_15) { - /* "dopt_pollublock_blockchain/blockchain.pyx":616 + /* "dopt_pollublock_blockchain/blockchain.pyx":627 * entries = self.get_saving_entries(max_value) * if not entries: * return # <<<<<<<<<<<<<< @@ -11276,7 +11498,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "dopt_pollublock_blockchain/blockchain.pyx":615 + /* "dopt_pollublock_blockchain/blockchain.pyx":626 * * entries = self.get_saving_entries(max_value) * if not entries: # <<<<<<<<<<<<<< @@ -11285,7 +11507,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":618 + /* "dopt_pollublock_blockchain/blockchain.pyx":629 * return * * with self._engine.begin() as con: # <<<<<<<<<<<<<< @@ -11300,13 +11522,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_begin, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); } - __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 618, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = NULL; - __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L18_error) + __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 629, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = 1; #if CYTHON_UNPACK_METHODS @@ -11325,7 +11547,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_3, __pyx_callargs+__pyx_t_9, (1-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L18_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 629, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_3 = __pyx_t_1; @@ -11343,7 +11565,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_v_con = __pyx_t_3; __pyx_t_3 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":619 + /* "dopt_pollublock_blockchain/blockchain.pyx":630 * * with self._engine.begin() as con: * con.execute(sql.insert(db.blocks), entries) # <<<<<<<<<<<<<< @@ -11353,14 +11575,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_4 = __pyx_v_con; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L22_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_insert); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 619, __pyx_L22_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_insert); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 630, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L22_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 619, __pyx_L22_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_9 = 1; @@ -11381,7 +11603,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L22_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_1); } __pyx_t_9 = 0; @@ -11390,12 +11612,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_3 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_execute, __pyx_callargs+__pyx_t_9, (3-__pyx_t_9) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 630, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":618 + /* "dopt_pollublock_blockchain/blockchain.pyx":629 * return * * with self._engine.begin() as con: # <<<<<<<<<<<<<< @@ -11418,20 +11640,20 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; /*except:*/ { __Pyx_AddTraceback("dopt_pollublock_blockchain.blockchain.Blockchain.save", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 618, __pyx_L24_except_error) + if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 629, __pyx_L24_except_error) __Pyx_XGOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_t_1); __Pyx_XGOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 618, __pyx_L24_except_error) + __pyx_t_8 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 629, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_8, NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 618, __pyx_L24_except_error) + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 629, __pyx_L24_except_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_14); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_15 < (0)) __PYX_ERR(0, 618, __pyx_L24_except_error) + if (__pyx_t_15 < (0)) __PYX_ERR(0, 629, __pyx_L24_except_error) __pyx_t_16 = (!__pyx_t_15); if (unlikely(__pyx_t_16)) { __Pyx_GIVEREF(__pyx_t_3); @@ -11439,7 +11661,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XGIVEREF(__pyx_t_4); __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4); __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; - __PYX_ERR(0, 618, __pyx_L24_except_error) + __PYX_ERR(0, 629, __pyx_L24_except_error) } __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11465,7 +11687,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain if (__pyx_t_10) { __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_mstate_global->__pyx_tuple[0], NULL); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 618, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -11480,7 +11702,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_L31:; } - /* "dopt_pollublock_blockchain/blockchain.pyx":606 + /* "dopt_pollublock_blockchain/blockchain.pyx":617 * return entries * * def save(self): # <<<<<<<<<<<<<< @@ -11514,7 +11736,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":621 +/* "dopt_pollublock_blockchain/blockchain.pyx":632 * con.execute(sql.insert(db.blocks), entries) * * def close_db_connections(self): # <<<<<<<<<<<<<< @@ -11575,7 +11797,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("close_db_connections", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":622 + /* "dopt_pollublock_blockchain/blockchain.pyx":633 * * def close_db_connections(self): * self._engine.dispose() # <<<<<<<<<<<<<< @@ -11589,12 +11811,12 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_dispose, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":621 + /* "dopt_pollublock_blockchain/blockchain.pyx":632 * con.execute(sql.insert(db.blocks), entries) * * def close_db_connections(self): # <<<<<<<<<<<<<< @@ -11616,7 +11838,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":624 +/* "dopt_pollublock_blockchain/blockchain.pyx":635 * self._engine.dispose() * * def load(self, batch_size): # <<<<<<<<<<<<<< @@ -11663,32 +11885,32 @@ PyObject *__pyx_args, PyObject *__pyx_kwds { PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_batch_size,0}; const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0; - if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 624, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 635, __pyx_L3_error) if (__pyx_kwds_len > 0) { switch (__pyx_nargs) { case 1: values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 624, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 635, __pyx_L3_error) CYTHON_FALLTHROUGH; case 0: break; default: goto __pyx_L5_argtuple_error; } const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(0, 624, __pyx_L3_error) + if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "load", 0) < (0)) __PYX_ERR(0, 635, __pyx_L3_error) for (Py_ssize_t i = __pyx_nargs; i < 1; i++) { - if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(0, 624, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, i); __PYX_ERR(0, 635, __pyx_L3_error) } } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0); - if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 624, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 635, __pyx_L3_error) } __pyx_v_batch_size = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 624, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("load", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 635, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11739,7 +11961,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("load", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":625 + /* "dopt_pollublock_blockchain/blockchain.pyx":636 * * def load(self, batch_size): * if self._loaded: # <<<<<<<<<<<<<< @@ -11748,7 +11970,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ if (unlikely(__pyx_v_self->_loaded)) { - /* "dopt_pollublock_blockchain/blockchain.pyx":626 + /* "dopt_pollublock_blockchain/blockchain.pyx":637 * def load(self, batch_size): * if self._loaded: * raise RuntimeError("Blockchain was already loaded") # <<<<<<<<<<<<<< @@ -11761,14 +11983,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Blockchain_was_already_loaded}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 626, __pyx_L1_error) + __PYX_ERR(0, 637, __pyx_L1_error) - /* "dopt_pollublock_blockchain/blockchain.pyx":625 + /* "dopt_pollublock_blockchain/blockchain.pyx":636 * * def load(self, batch_size): * if self._loaded: # <<<<<<<<<<<<<< @@ -11777,7 +11999,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain */ } - /* "dopt_pollublock_blockchain/blockchain.pyx":628 + /* "dopt_pollublock_blockchain/blockchain.pyx":639 * raise RuntimeError("Blockchain was already loaded") * * with self._engine.connect() as con: # <<<<<<<<<<<<<< @@ -11792,13 +12014,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_connect, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 628, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; - __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 628, __pyx_L4_error) + __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = 1; #if CYTHON_UNPACK_METHODS @@ -11817,7 +12039,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 628, __pyx_L4_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 639, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_6 = __pyx_t_2; @@ -11835,7 +12057,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_v_con = __pyx_t_6; __pyx_t_6 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":629 + /* "dopt_pollublock_blockchain/blockchain.pyx":640 * * with self._engine.connect() as con: * res = con.execute(sql.select(db.blocks).order_by(db.blocks.c.index.asc())) # <<<<<<<<<<<<<< @@ -11845,14 +12067,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_1 = __pyx_v_con; __Pyx_INCREF(__pyx_t_1); __pyx_t_11 = NULL; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 629, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_sql); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_select); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 629, __pyx_L8_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_select); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 629, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 629, __pyx_L8_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_3 = 1; @@ -11873,20 +12095,20 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 629, __pyx_L8_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_10); } __pyx_t_5 = __pyx_t_10; __Pyx_INCREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 629, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_db); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 629, __pyx_L8_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_blocks); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 629, __pyx_L8_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_c); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 629, __pyx_L8_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_14 = __pyx_t_12; @@ -11897,7 +12119,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_13 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_asc, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 629, __pyx_L8_error) + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_13); } __pyx_t_3 = 0; @@ -11907,7 +12129,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 629, __pyx_L8_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_t_3 = 0; @@ -11916,13 +12138,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_6 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_execute, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 629, __pyx_L8_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 640, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); } __pyx_v_res = __pyx_t_6; __pyx_t_6 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":628 + /* "dopt_pollublock_blockchain/blockchain.pyx":639 * raise RuntimeError("Blockchain was already loaded") * * with self._engine.connect() as con: # <<<<<<<<<<<<<< @@ -11946,20 +12168,20 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; /*except:*/ { __Pyx_AddTraceback("dopt_pollublock_blockchain.blockchain.Blockchain.load", __pyx_clineno, __pyx_lineno, __pyx_filename); - if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 628, __pyx_L10_except_error) + if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_2, &__pyx_t_1) < 0) __PYX_ERR(0, 639, __pyx_L10_except_error) __Pyx_XGOTREF(__pyx_t_6); __Pyx_XGOTREF(__pyx_t_2); __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_10 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 628, __pyx_L10_except_error) + __pyx_t_10 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 639, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 628, __pyx_L10_except_error) + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 639, __pyx_L10_except_error) __Pyx_GOTREF(__pyx_t_15); __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__pyx_t_16 < (0)) __PYX_ERR(0, 628, __pyx_L10_except_error) + if (__pyx_t_16 < (0)) __PYX_ERR(0, 639, __pyx_L10_except_error) __pyx_t_17 = (!__pyx_t_16); if (unlikely(__pyx_t_17)) { __Pyx_GIVEREF(__pyx_t_6); @@ -11967,7 +12189,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XGIVEREF(__pyx_t_1); __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_2, __pyx_t_1); __pyx_t_6 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; - __PYX_ERR(0, 628, __pyx_L10_except_error) + __PYX_ERR(0, 639, __pyx_L10_except_error) } __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11993,7 +12215,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain if (__pyx_t_4) { __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 628, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -12008,14 +12230,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_L17:; } - /* "dopt_pollublock_blockchain/blockchain.pyx":631 + /* "dopt_pollublock_blockchain/blockchain.pyx":642 * res = con.execute(sql.select(db.blocks).order_by(db.blocks.c.index.asc())) * * for batch in res.partitions(batch_size): # <<<<<<<<<<<<<< * self.load_from_batch(batch) * */ - if (unlikely(!__pyx_v_res)) { __Pyx_RaiseUnboundLocalError("res"); __PYX_ERR(0, 631, __pyx_L1_error) } + if (unlikely(!__pyx_v_res)) { __Pyx_RaiseUnboundLocalError("res"); __PYX_ERR(0, 642, __pyx_L1_error) } __pyx_t_2 = __pyx_v_res; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; @@ -12023,7 +12245,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_batch_size}; __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_partitions, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { @@ -12031,9 +12253,9 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __pyx_t_18 = 0; __pyx_t_19 = NULL; } else { - __pyx_t_18 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_18 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 631, __pyx_L1_error) + __pyx_t_19 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 642, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -12042,7 +12264,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 642, __pyx_L1_error) #endif if (__pyx_t_18 >= __pyx_temp) break; } @@ -12052,7 +12274,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_SIZE - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 642, __pyx_L1_error) #endif if (__pyx_t_18 >= __pyx_temp) break; } @@ -12063,13 +12285,13 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain #endif ++__pyx_t_18; } - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error) } else { __pyx_t_1 = __pyx_t_19(__pyx_t_2); if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { - if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 631, __pyx_L1_error) + if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 642, __pyx_L1_error) PyErr_Clear(); } break; @@ -12079,18 +12301,18 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain __Pyx_XDECREF_SET(__pyx_v_batch, __pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":632 + /* "dopt_pollublock_blockchain/blockchain.pyx":643 * * for batch in res.partitions(batch_size): * self.load_from_batch(batch) # <<<<<<<<<<<<<< * * self._loaded = True */ - __pyx_t_1 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->load_from_batch(__pyx_v_self, __pyx_v_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 632, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_26dopt_pollublock_blockchain_10blockchain_Blockchain *)__pyx_v_self->__pyx_vtab)->load_from_batch(__pyx_v_self, __pyx_v_batch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":631 + /* "dopt_pollublock_blockchain/blockchain.pyx":642 * res = con.execute(sql.select(db.blocks).order_by(db.blocks.c.index.asc())) * * for batch in res.partitions(batch_size): # <<<<<<<<<<<<<< @@ -12100,14 +12322,14 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":634 + /* "dopt_pollublock_blockchain/blockchain.pyx":645 * self.load_from_batch(batch) * * self._loaded = True # <<<<<<<<<<<<<< */ __pyx_v_self->_loaded = 1; - /* "dopt_pollublock_blockchain/blockchain.pyx":624 + /* "dopt_pollublock_blockchain/blockchain.pyx":635 * self._engine.dispose() * * def load(self, batch_size): # <<<<<<<<<<<<<< @@ -12139,7 +12361,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":330 +/* "dopt_pollublock_blockchain/blockchain.pyx":341 * bint _genesis_done * bint _loaded * readonly object db_path # <<<<<<<<<<<<<< @@ -12178,7 +12400,7 @@ static PyObject *__pyx_pf_26dopt_pollublock_blockchain_10blockchain_10Blockchain return __pyx_r; } -/* "dopt_pollublock_blockchain/blockchain.pyx":331 +/* "dopt_pollublock_blockchain/blockchain.pyx":342 * bint _loaded * readonly object db_path * readonly object _engine # <<<<<<<<<<<<<< @@ -12492,11 +12714,12 @@ static PyObject *__pyx_getprop_26dopt_pollublock_blockchain_10blockchain_7PyBloc } static PyMethodDef __pyx_methods_26dopt_pollublock_blockchain_10blockchain_PyBlock[] = { - {"serialize_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11serialize_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"bytes_serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13bytes_serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"perform_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15perform_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"as_dataclass", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11as_dataclass, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"serialize_dict", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13serialize_dict, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"bytes_serialize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15bytes_serialize, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"perform_hash", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17perform_hash, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_26dopt_pollublock_blockchain_10blockchain_7PyBlock_21__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; @@ -12905,15 +13128,15 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock = &__pyx_vtable_26dopt_pollublock_blockchain_10blockchain_PyBlock; __pyx_vtable_26dopt_pollublock_blockchain_10blockchain_PyBlock.from_ptr = (struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_PyBlock *(*)(::Block *, struct __pyx_opt_args_26dopt_pollublock_blockchain_10blockchain_7PyBlock_from_ptr *__pyx_optional_args))__pyx_f_26dopt_pollublock_blockchain_10blockchain_7PyBlock_from_ptr; #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_26dopt_pollublock_blockchain_10blockchain_PyBlock_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock)) __PYX_ERR(0, 86, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_26dopt_pollublock_blockchain_10blockchain_PyBlock_spec, __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 86, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_26dopt_pollublock_blockchain_10blockchain_PyBlock_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock)) __PYX_ERR(0, 87, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_26dopt_pollublock_blockchain_10blockchain_PyBlock_spec, __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 87, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock = &__pyx_type_26dopt_pollublock_blockchain_10blockchain_PyBlock; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 86, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 87, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock); @@ -12923,10 +13146,10 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock->tp_getattro = PyObject_GenericGetAttr; } #endif - if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 86, __pyx_L1_error) - if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 86, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PyBlock, (PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 86, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 86, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 87, __pyx_L1_error) + if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 87, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_PyBlock, (PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 87, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock) < (0)) __PYX_ERR(0, 87, __pyx_L1_error) __pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_Blockchain = &__pyx_vtable_26dopt_pollublock_blockchain_10blockchain_Blockchain; __pyx_vtable_26dopt_pollublock_blockchain_10blockchain_Blockchain.get_block_c = (::Block *(*)(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *, uint64_t))__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_get_block_c; __pyx_vtable_26dopt_pollublock_blockchain_10blockchain_Blockchain.add_block_from_loading = (void (*)(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *, ::Block *))__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_add_block_from_loading; @@ -12934,15 +13157,15 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_vtable_26dopt_pollublock_blockchain_10blockchain_Blockchain.hash_data = (std::string (*)(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *, PyObject *))__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_hash_data; __pyx_vtable_26dopt_pollublock_blockchain_10blockchain_Blockchain.load_from_batch = (PyObject *(*)(struct __pyx_obj_26dopt_pollublock_blockchain_10blockchain_Blockchain *, PyObject *))__pyx_f_26dopt_pollublock_blockchain_10blockchain_10Blockchain_load_from_batch; #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain)) __PYX_ERR(0, 322, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain_spec, __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain)) __PYX_ERR(0, 333, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain_spec, __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 333, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain = &__pyx_type_26dopt_pollublock_blockchain_10blockchain_Blockchain; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 333, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain); @@ -12952,10 +13175,10 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain->tp_getattro = PyObject_GenericGetAttr; } #endif - if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) - if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Blockchain, (PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 322, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_vtabptr_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 333, __pyx_L1_error) + if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 333, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Blockchain, (PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 333, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain) < (0)) __PYX_ERR(0, 333, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -13326,7 +13549,7 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); * import sqlalchemy as sql * from dopt_pollublock_blockchain import db # <<<<<<<<<<<<<< * - * + * from dopt_pollublock_blockchain import types */ { PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_db}; @@ -13345,49 +13568,88 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":145 + /* "dopt_pollublock_blockchain/blockchain.pyx":14 + * from dopt_pollublock_blockchain import db + * + * from dopt_pollublock_blockchain import types # <<<<<<<<<<<<<< + * + * from dopt_pollublock_blockchain.block cimport Block +*/ + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; + __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain, __pyx_imported_names, 1, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) + } + __pyx_t_2 = __pyx_t_1; + __Pyx_GOTREF(__pyx_t_2); + { + PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_types}; + __pyx_t_3 = 0; { + __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 14, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "dopt_pollublock_blockchain/blockchain.pyx":146 * return self.__repr__() * + * def as_dataclass(self): # <<<<<<<<<<<<<< + * return types.PyBlockData( + * Index=self.index, +*/ + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11as_dataclass, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_as_dataclass, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 + PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); + #endif + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_as_dataclass, __pyx_t_2) < (0)) __PYX_ERR(0, 146, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "dopt_pollublock_blockchain/blockchain.pyx":156 + * ) + * * def serialize_dict(self): # <<<<<<<<<<<<<< * contents = {} * */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_11serialize_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_serialize_dict, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13serialize_dict, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_serialize_dict, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_serialize_dict, __pyx_t_2) < (0)) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_serialize_dict, __pyx_t_2) < (0)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":182 + /* "dopt_pollublock_blockchain/blockchain.pyx":193 * return self.BlockC.hash.decode("UTF-8") * * def bytes_serialize(self): # <<<<<<<<<<<<<< * cdef: * unsigned char *serialize_res */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_13bytes_serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_bytes_serialize, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15bytes_serialize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_bytes_serialize, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_bytes_serialize, __pyx_t_2) < (0)) __PYX_ERR(0, 182, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_bytes_serialize, __pyx_t_2) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":193 + /* "dopt_pollublock_blockchain/blockchain.pyx":204 * * * def perform_hash(self): # <<<<<<<<<<<<<< * cdef: * unsigned char *digest */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_15perform_hash, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_perform_hash, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17perform_hash, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_perform_hash, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_perform_hash, __pyx_t_2) < (0)) __PYX_ERR(0, 193, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_PyBlock, __pyx_mstate_global->__pyx_n_u_perform_hash, __pyx_t_2) < (0)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 @@ -13395,7 +13657,7 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); @@ -13409,7 +13671,7 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_7PyBlock_21__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); @@ -13417,154 +13679,154 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < (0)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":459 + /* "dopt_pollublock_blockchain/blockchain.pyx":470 * return self._index * * def _print_key_value_pair(self): # <<<<<<<<<<<<<< * cdef BcHashmap.iterator it = self._chain_map.begin() * cdef Block *block */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_9_print_key_value_pair, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain__print_key_value_pair, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_9_print_key_value_pair, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain__print_key_value_pair, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_print_key_value_pair, __pyx_t_2) < (0)) __PYX_ERR(0, 459, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_print_key_value_pair, __pyx_t_2) < (0)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":469 + /* "dopt_pollublock_blockchain/blockchain.pyx":480 * postincrement(it) * * def print_blocks(self, max_num): # <<<<<<<<<<<<<< * cdef: * Block *block */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_11print_blocks, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_print_blocks, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_11print_blocks, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_print_blocks, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_print_blocks, __pyx_t_2) < (0)) __PYX_ERR(0, 469, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_print_blocks, __pyx_t_2) < (0)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":486 + /* "dopt_pollublock_blockchain/blockchain.pyx":497 * break * * def get_block(self, idx): # <<<<<<<<<<<<<< * if idx < 0 or idx > self._index: * raise IndexError("Index value is out of bounds") */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_13get_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_get_block, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_13get_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_get_block, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_get_block, __pyx_t_2) < (0)) __PYX_ERR(0, 486, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_get_block, __pyx_t_2) < (0)) __PYX_ERR(0, 497, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":495 + /* "dopt_pollublock_blockchain/blockchain.pyx":506 * return PyBlock.from_ptr(block, owner=False) * * def create_genesis_block(self): # <<<<<<<<<<<<<< * if self._genesis_done: * raise RuntimeError( */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_15create_genesis_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_create_genesis_block, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_15create_genesis_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_create_genesis_block, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_create_genesis_block, __pyx_t_2) < (0)) __PYX_ERR(0, 495, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_create_genesis_block, __pyx_t_2) < (0)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":518 + /* "dopt_pollublock_blockchain/blockchain.pyx":529 * self._genesis_done = True * * def new_block(self, data): # <<<<<<<<<<<<<< * cdef: * Block *prev_block */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_17new_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_new_block, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_17new_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_new_block, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_new_block, __pyx_t_2) < (0)) __PYX_ERR(0, 518, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_new_block, __pyx_t_2) < (0)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":551 + /* "dopt_pollublock_blockchain/blockchain.pyx":562 * return self._index * * def validate(self): # <<<<<<<<<<<<<< * cdef: * Block *block */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_19validate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_validate, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_19validate, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_validate, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_validate, __pyx_t_2) < (0)) __PYX_ERR(0, 551, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_validate, __pyx_t_2) < (0)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":579 + /* "dopt_pollublock_blockchain/blockchain.pyx":590 * return True * * def get_saving_entries(self, min_idx): # <<<<<<<<<<<<<< * entries = [] * cdef: */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_21get_saving_entries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_get_saving_entries, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_21get_saving_entries, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_get_saving_entries, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_get_saving_entries, __pyx_t_2) < (0)) __PYX_ERR(0, 579, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_get_saving_entries, __pyx_t_2) < (0)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":606 + /* "dopt_pollublock_blockchain/blockchain.pyx":617 * return entries * * def save(self): # <<<<<<<<<<<<<< * # get max index from db * # only retrieve indices greater than max value */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_23save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_save, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_23save, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_save, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_2) < (0)) __PYX_ERR(0, 606, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_save, __pyx_t_2) < (0)) __PYX_ERR(0, 617, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":621 + /* "dopt_pollublock_blockchain/blockchain.pyx":632 * con.execute(sql.insert(db.blocks), entries) * * def close_db_connections(self): # <<<<<<<<<<<<<< * self._engine.dispose() * */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_25close_db_connections, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_close_db_connections, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 621, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_25close_db_connections, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_close_db_connections, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_close_db_connections, __pyx_t_2) < (0)) __PYX_ERR(0, 621, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_close_db_connections, __pyx_t_2) < (0)) __PYX_ERR(0, 632, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dopt_pollublock_blockchain/blockchain.pyx":624 + /* "dopt_pollublock_blockchain/blockchain.pyx":635 * self._engine.dispose() * * def load(self, batch_size): # <<<<<<<<<<<<<< * if self._loaded: * raise RuntimeError("Blockchain was already loaded") */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_27load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_load, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_27load, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_load, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); #endif - if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_2) < (0)) __PYX_ERR(0, 624, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_26dopt_pollublock_blockchain_10blockchain_Blockchain, __pyx_mstate_global->__pyx_n_u_load, __pyx_t_2) < (0)) __PYX_ERR(0, 635, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 @@ -13572,7 +13834,7 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" * def __setstate_cython__(self, __pyx_state): */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); @@ -13586,7 +13848,7 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * raise TypeError, "no default __reduce__ due to non-trivial __cinit__" */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_26dopt_pollublock_blockchain_10blockchain_10Blockchain_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_dopt_pollublock_blockchain_block, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount(__pyx_t_2); @@ -13641,7 +13903,7 @@ __Pyx_RefNannySetupContext("PyInit_blockchain", 0); static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); - __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 474, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; @@ -13661,14 +13923,14 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - /* "dopt_pollublock_blockchain/blockchain.pyx":610 + /* "dopt_pollublock_blockchain/blockchain.pyx":621 * # only retrieve indices greater than max value * stmt = sql.select(sql.func.max(db.blocks.c.index)) * with self._engine.connect() as conn: # <<<<<<<<<<<<<< * result = conn.execute(stmt) * max_value = result.scalar() */ - __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 610, __pyx_L1_error) + __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 621, __pyx_L1_error) __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]); __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]); #if CYTHON_IMMORTAL_CONSTANTS @@ -13694,31 +13956,31 @@ static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) { static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) { CYTHON_UNUSED_VAR(__pyx_mstate); { - const struct { const unsigned int length: 8; } index[] = {{72},{29},{25},{25},{36},{29},{9},{21},{33},{32},{19},{13},{9},{97},{29},{6},{28},{37},{13},{24},{18},{65},{5},{2},{1},{1},{7},{6},{2},{9},{50},{10},{10},{45},{14},{13},{10},{28},{30},{32},{31},{31},{20},{29},{15},{20},{23},{15},{19},{4},{7},{25},{27},{23},{20},{22},{20},{12},{3},{18},{5},{10},{5},{5},{6},{15},{1},{18},{20},{3},{4},{7},{8},{10},{13},{20},{15},{16},{4},{11},{8},{8},{2},{7},{6},{11},{7},{11},{20},{26},{37},{6},{9},{7},{7},{6},{8},{8},{7},{13},{4},{8},{12},{17},{9},{18},{12},{4},{3},{3},{5},{6},{13},{2},{5},{4},{8},{3},{7},{11},{9},{19},{7},{8},{10},{8},{9},{7},{5},{3},{8},{6},{10},{7},{12},{3},{10},{9},{13},{5},{12},{21},{8},{8},{17},{11},{14},{12},{10},{17},{13},{8},{3},{7},{6},{4},{6},{6},{4},{14},{13},{14},{12},{10},{12},{19},{3},{10},{4},{8},{9},{8},{6},{0},{64},{75},{85},{115},{95},{70},{155},{11},{39},{71},{101},{187},{180},{112},{9}}; - #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (1991 bytes) */ -const char* const cstring = "BZh91AY&SY&r\r\301\000\001r\177\377\377\377\377\377\377\377\377\367\277\377\377\373\277\357\377\370@@@@@@@@@@@@@\000@\000`\007\177\036\001\310SZ*\224\022ILp`\202\2114\364 \000\003Cj`\322m6\244h\000\003i\006F\232\003@4\003F\217P\332L\214\214OPd\2014\311\224LhS\311=G\251\241\243@\000\000\000\000\000\000\000\000\320\000\000\020i\211\211\211\200\230\t\200\000\000\000L\000\0010\000\t\200\000\000\000\232\004\246\204 @\214\232O@S\301S\364\247\244di\210\365=@\0004\000\000\006\200\000\315\250\214'\250\323D\032bbb`&\002`\000\000\000\023\000\000L\000\002`\000\000\000&\201\"T\364*z\233(zi\017\325\036\325\0004\000\000hdz\201\240\000\000\310\000\000d\3204\3204\3653\265\357\353\303l1\222\373\201\226\277\031\237\222Y\225\224\225g\374\236\002x#5\204\367\205)\350\2051\2332\240\013\311\261\2611\2646\332hg(-%L;\360\210\206\354Q\302\310\337\342[\346\342\325|R\202\331\240\000\264\333\020\r\245y\242bd`*\023\276\324\247\224\005P\230CPkR\032FM3\327\266[\245\235\261k\333f\351\263\220\363D\222\247\0067\2410E\273\"Er\241\223\260J\271\263\346\264\321\020\236\230\231\253B\202\234Y\314\032\315\204v\251\022)\207~\366\272\246\224e7w\033\217ar/m\374\221\353\373~;'.\207\004%\035\316\376\277\255\354V:\372a\352\375\303\237\362\316\\\217\366MZ\373L\226,a\241D{W\337i+\201\231\030\342g\233\255[eh\266\034\333{\307\017\213\2349E\325\304\316\237\335\210Vt\272\242b\363\226\353J\357s\371s\361rv\367P\336\236\377\313\327\206\344\223\375n'\254\244\204\271\327\032\010L\227W\333\177i\376\225|\346}\006\315\315\267r\222\tB\204DC\260\372\300y!\332\024}\310)\301\257\253\247\243\311>_\202r\310\315v\231\245t\226\226\010h\"VY\264%l[\026Z\320]\245'6\233\332q\231{\010LJU\233s\366\272\353\324\321/\305w\000\266\005c\325\233Z\314\254a\303\222Z\034&\201q\2157\232\34749I\350\257\327}\377K\020\033;\325'\230s\034\333\235\237P@;\263$\275\016\310nz\370\375c\317\321%q\273\010I4\257\354\344d\342EY\212\243\255U3F\216\220xf\200\212>\265\321\266\335\243\317\005\327D+\270\213\340\276\0139\010\271{\234-\3133>\036\2700sG\220\266\003\027""\273\317`\2352\021\341\301\335\351\230\312\2715\205\251\3359\0062\326\320\260\263\016\253B\010`\274L[\344\245\244]0\341]\241B!.\202dOR\032\020@k&\010\026\020\346\017\325\377\027\001\003o\351=\304H\332[;`c\211\202\215\247\251\252;\201\t0\342\321\3439\006\301\250o\320\234\232\023!\235\261\377H\3528X\275\274\325\324\307W\231\337r;\016a\320\221\014\260\254\352\3520,\315p'\262P\025\221B\251\\\215\3535\254\014\034\242\215T\211\254\305\253~\227^EN\263T\023\240m1\306\032Xat\346\236\334\030\030\262\003\233M\365\315\231\313\304Q\315\212\235j\321\n\005\n\251\376\261\340\353pV\030 P\013)0\245ABj\234\255\330|\307E\373\322`_\205\370\261y\013\212\235\330\016Nh\266\347q\rL\262\014\215\\\274\277_F\254t\360\3012\373\251\245\017J\245\337\210\357N\323\231\347\235B\243\274\244\222\274\221\341\030\334I^\021\212\301j\206\024\303\301\2118\314\031c\204\341\027\215\026\363n#\031\317X\270\233b\273\315\370\347\301\303IDB\373K\246,\016Ide\211\002\344\300\037c\000\244\330\245j&\251B\313}\221\010\301\020\362(M!\010\243f\r\024\304\216-\352z=\007\026\246\243X\032@\371\004\024\253\005\373\254\205\223\007\206\025\010\034vRmm\024\004\312\031P\267q\006\002\205N3\010\261}\351\207\231=\024V\035\370s\271\014\311\274\243v\301\265\332\207\203q\302P\261\234\341W\265\2137NCU\364\241\203\"\3569\245)\215-+\014E\246n\200\2751\305\301\321IL\275\004\2205\362TC\256\252uk\022\345\206E\000DKWD\211\004LL\332\177\362-\314\034\370\362;?\rK\256v\016f\\\271\365\231\037\347\021&L&H\023\t3$$\231\213\313\027\346b\255\003a\032\207\321\216\"\327\266\264\264\\\332\206\325\205N\014K\210Vj\354\265\326\t\241\r(\0010\222h3zW\315\345[\341Y\361\223\303T!\345\322%\235\332\214\333.\350\226\224\324\016,\347\241\276\354\322QTpI\334t\021p\370j:\325u30\333u\3460n\266\333\265\261\342\0315\305l\340@\243\326C#\014\360p\302\031!U1'^^(\234\205O\002\2546\2030MK}\370=\206\323k\257!\267\341D\"\320\266<\205\302q\246\226\205\234:l\274h\023\030\031cR\242\240\3068\347\231\021\360)\t\265\351A\302\357\261l\317\320\364\3448\371X\3550\327\255\010[y\022""\214\244\315\347ha\314\350d\303\260\263\221\314\331\240\245r\322d\364.\207\340\331I*\343\324RR\231\364\303\216kp\017F\254\253'\023\262\003\\\221\203a\026L\013\215\252\025Ze\266E\010\271(\222P\225\234K\203.\320\265\337\320\277V\301X\026hY\023\016B\241\224\273\277\0276y\303*\315\360\322;\031\356\234\347c\355\224\256\327<\306\343\320\370\0303\342\343\213\234\323:\014;\353\300\276B\352A\r\r\302F6y2\347\316\231)\"\341\0068CA\024\2366\373\304\022\255u5\332\023i\362\340\310\302;7Y\355\250 yAQ\347\356t\245/|\262\356\320/Ky\303/\031\341\321\206\211uM\336D\360Dkd\020\0223\362\316\006%u\314[\035`=\360<\371\034\245\320\006\221\310>)\274\024\245\300\025\350\0079\005)\347\036I\316f\t\n\261C\020\210\201\242~`m\337\247\370Q\224\032_\215\220\252\010\0133&\324\320L\310\017\373\023(\007\022\321X\006\242\241Tdj\243\0053g\2271\340u\027\341\007\366\230C\361#\302$!\254 \251^aT\277\224\003\001\223\003M\030\211$\025N\323]\361\006\372\257UJ8J{\"K\241u\345\312\341\334\304\\\341\270\\\203E\333q\365\275\013\250Wrb\360\271mA\204X\274\267B\003G\260\331?|~\303\216\233\206\330\371\373'\305F\316c\307\017E\245\021ER\261\016t\202\243\225\232\323um\021K\212\t\350\366\261AV\252\005a@\243\323V\261u\303\275\034\265/\255nJ\267C\302\213\377\014\326^\216\357K\354=\357g/\272kD$\375\256\177\361w$S\205\t\002g \334\020"; - PyObject *data = __Pyx_DecompressString(cstring, 1991, 2); + const struct { const unsigned int length: 8; } index[] = {{72},{29},{25},{25},{36},{29},{9},{21},{33},{32},{19},{13},{9},{97},{29},{6},{28},{37},{10},{13},{24},{18},{65},{13},{5},{2},{1},{1},{7},{6},{2},{9},{50},{10},{45},{14},{10},{28},{30},{32},{31},{31},{20},{29},{15},{20},{23},{15},{19},{4},{4},{5},{5},{4},{8},{7},{11},{25},{27},{20},{23},{20},{22},{20},{12},{9},{12},{3},{18},{5},{10},{5},{5},{6},{15},{1},{18},{20},{3},{4},{7},{8},{10},{13},{20},{15},{16},{4},{11},{8},{8},{2},{7},{6},{11},{7},{11},{20},{26},{37},{6},{9},{7},{7},{6},{8},{8},{7},{13},{4},{8},{12},{17},{9},{18},{12},{4},{3},{3},{5},{6},{13},{2},{5},{4},{8},{3},{7},{11},{9},{19},{7},{8},{10},{8},{9},{7},{5},{3},{8},{6},{10},{7},{12},{3},{10},{9},{13},{5},{12},{21},{8},{8},{17},{11},{14},{12},{10},{17},{13},{8},{3},{7},{6},{4},{6},{6},{4},{14},{13},{14},{12},{10},{12},{19},{3},{10},{4},{8},{9},{5},{8},{6},{0},{64},{75},{85},{115},{95},{70},{155},{11},{39},{71},{101},{187},{180},{112},{53},{9}}; + #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (2039 bytes) */ +const char* const cstring = "BZh91AY&SY\372D\323\024\000\001~\377\377\377\377\377\377\377\377\377\367\277\377\377\373\277\357\377\370@@@@@@@@@@@@@\000@\000`\007\277\016\352\275ckpM\ne\266m\202\255^\0171\005\ni\350\324\000\000\007\240O!\251\275H\320\000\006\322\r\006@h\320h\003M\0321\0314\311\211\352\tDh\002\020\230\206Jz\r\021\210\032\000\000\000\000\000\000\000\001\2404\006\200\rOM \2256\246\201\275S\323MF\236\243\312i\243\324\000\000\000\000\000\000\000\000\r\014\2004\032\r2\232D\320\214SmQ\351\352\231\211\014\236\240\003C\324\r\032\001\240\323F\200\000\003@\001\246\200\000 \323\023\023\023\0010\023\000\000\000\000\230\000\002`\000\023\000\000\000\0014\t\022&\225<2h&\232\246\3622\243\305=M\001\240\000h\000\000\000\036\240\000\000\031\014\232\032z\236\245\373\331/Cl8\222\350\201\322_\317O\372'\323\222\230I\365)\001H#\215\2059\005:W\n\243\216\245X\034\211\261\2614\332\033m43\311\r\031\022fDJ\"0\327\337\376}\337;\225\322\362\265H\320\203!\210\002\346\330\010m.F\212\212\221\225\324O\"\252\256\254\n1\241\215\205B\256\251)\211\251\317\203<\321\274\241`W\241\205i\347\024\035E\311&5\340U\002\014\000S\306N\r\014E\206\200\016P\2440p\224\010\250\365\035\013\030F\004\005k#\212$\222\257\346+\n\244+\315\242N&e,=2\205\241\3676\317\345\262\327\322\337\312e\205\023\000A+%\233\347\225\366\222\273\216\232M\222\030\177Rq5:CE)&bD\212\344\257\177\357JI\210\324\301KX\305\247(\312\362|\363ZK6\206\036\352\340\030\240\336\215\270\"\263\022.\304\302\362uP\305\244\334\332\271}\3676\032\031\2047\203\013\205f\235\004\225\233\251R9$\222n\234B\004\013\023\254\317_e\231&\335\225a=\020\263\210\\ \344\024BI\240\033\010\000\316\023A\025\322B:\033\225\336\272\331z\273\362\261s\t\346hG1&ARHa\231\273P\036\317g\244 $y\250\035\nn\365G;wh\274.vow\037\276:\346\355d\251\217K^\240\322\032\317\263\241\255\351\225\2708:d\201\023%n\301\320\275\353\277\t\360\312$\234\247\325\277\366\355\2458\377\256\207\335w\363\314\254c\276\254`e\300\344v\220x9\314 B&\375\3506\256::B\375\201\351\213KU\352@\222\316}hC\001\002D\201\205R+20\206{\030\010\250A""\000\242\326M\352\347|3\341\322\211\032h\305HT\201\231\010\212G\371\206\324;\275\334\210\nhV\374\211i\206 \2012O\255\005\026 \215\3754\224p/\033\244\205\316\347+\207\226d\226KY \345\214\007\217A\374fy<\034\365\264q(md+m\005/\274v\314\346\214e\363\267\264A\211\256\300\352h\347g$,\267\034l\230\256V\205\363\006\002\373\226\331\267,\271*\350!\266\332 u\227s\315Li`T3TN\305&\230\241`\350\263|\261\027\2275\357#{\264\346A.\003XC\033!\230U\235f\243j\312\264\205,+\t\"\265\251i\216\351\232X\034\034\362\275\223*\2621\345\363\367\360\2247\314r&\361\n\350\324\027!\017e\223\341\276\220\212\330\014\327u\352Yc\212\026X\302\316\216\215\0108EGS\375i\211\327\354\3241TP\311q\034\352\270\305\3241\303s'1\311\246\206*R\264\260\224\036\273a\370\324p\330>[\034\341D\205\356\027,\013v\363\253X\251^\324\003\272\2425\310Q\220\233\312\020\303:\201qF\351\201\212NI&a\207=KLb;\302\021y(\205a^u\206\263<\275\252\325}\004|\271\363\037f\306/\231\214,\375\330tx\342m\242*\252OC\351f\"\270g\352\014\004\212\354'\226\302\211\225\036\344K\262\213}\300Q\367qe\031\320\025\352\220A\352E0C(\\~\335\020\3559&\335\t\004\314s\t\340)Gl\336\334j\346J\314dqT\344f\\a\tH^#\212\270VH\241\213\"\020f\010J&\230\260N\342\371\022A+X(A\230\2660\242p\232e\003\251\330o\020$bo-\022D\223\212\351\220\244\237\231D\014\np4!\013\302L\266\270\271\332o\n+E\"F\353\216I50R\023\301\326\"\272\361\277=t\344\326Pm\345\316X\204\213F\225\337\363\201\327\2546`\334\205\035U\n\371P\203Z{\266\3460\237\306\001\264\304\323\03046\223cm\"\361Yz\304QHW\345\214vV\260\272\267c\t>i\235\023=bk\2611\353 \216\251N@\320\036\214\240\005\201%\24003fy\204\200d\312\2528\336\310X\204\350\220\354\223E\232zZ\247gj\240\323i\221\245\"n\242\001\270\202\030J\262/\\o\272\\\201,\371p\225NRk\326\226\330\"\334Z\022\233\202\310\264z\r{p\2216\r\211\205,\211\331\244\311e\201y\205\366h\033\177\030=\247\273YF\t\271\035Z\263\303v\322\265\340=\246\203\353\215\251H\0105\030\3675\350+\240d\r\222d\035\320Cg\010mc\002\326k\220-%9\237\007\031G\024\325\272\216\022\376l\314c\333\334nXfY""\333\030\221\005\254M\020\207i-j\311\020\215\363\027t\t\275\332\365A\210\270tG-\027\216\273y\031\262i$\305\242\311\221\321\340\341\236\2022ZZ\026\273d\032a\205o\270\330\265\225\r8Y\000TG\247\013\352\332\344\367\357H\353_!a\2442x\230\022Tq\310~\256\214\340Sy3\341\244pd9\014f\330\234\275cMw#\264\300\261E*\366E \330 s\224ea\005B\316z\275*\240\223\223\325\342\350\r\017C@\252\220s\010\3230t\312\2220\265Q\213\022l\036\216;\325\305*\030Q\"\225\344F\303g2\213pM\264gQ\230\263\t\226\320\324V\023\0310W\n^\367N2fC\206\333\206tl^\271\227U\307\020#W$\213\362\370\271P\r\212\336\321|\223rQ(\010\210\257\034\215\323\227\274#\226\2532\360\323D\006\201R\266`\244\354\002\252x#\020{\017)\025\240o\343\311\231\332\r\314,G4\201\333n\343{\303g\240\210b\341#\212\324\315=\r\023D\321\244\203\337\0244\021\240\371\033\342 \234\2744\327\266\"X\362\026I\366\235\330\352,\264\336\214P\020:>\240Z\330\320\354g\027x\303\351\227(o%\315&\363nT;p\177\n<\310\220\333\240\r\305\024\010\t\264\354\3208\030\354\355\223+&P\036\354\024\372\034\311\250\2037d\022\351\342\n\262\036\014\331\341\030\202\214\343\217%\276Y\002\242\274 vD@\315o@4:T\026Ot\303I\222H\325\004E\221\226hg\306@\017\240&z\007\024\250L\003AzU\0205Q|\261\264\n1\340u\027\200\373\366\230@\361#\302\013\361\254 \251^a\\\277\236\201\200\313\001\245\214\025U\n\247jLtA\302\272\213\253\276\021\324\211\025\300\270\221\316\233\231-[\266Na\006\223\234\001\237z\027O\356\342\302\343n\224\366\032\261yn\216+5 \361\321\373)\365\\$\223\372\337w\030`\214\r\022c\026\316\220\242d$\223\013\240\030\260\223\3128\222\232Q\240\213\273I\304d\323q\020e\"\201\230(\031\277\210\321P\032\006h\260\234j\224\250L\251\005\003\t\272\317#\250\244\2434\241L\245BjO$H%^C\376.\344\212p\241!\364\211\246("; + PyObject *data = __Pyx_DecompressString(cstring, 2039, 2); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (1874 bytes) */ -const char* const cstring = "x\332\245UIs\033\307\025\026\274H\000\004Z\004)\222r\304X\203X\212\255$\002M[\211\025V\226\202DjIbE\224)'Q*\351\032\3144\200)\017f\200\231\036\022P.:\342\330\307>\366q\2168\362\250\243\216<\342\310\237\240\237\340\3575\006\213E\250*\225\260\300\336^\367{\357\373\3362w\375\320\371\336i\331^`\331~\304m\267o\265\354\330\262\255&\017x\354\305V\235.T\255=O\264xdy\302:\202\330\301M\301]+\214,?\264]\356V\357\316\364\320\205\211\256\261\364^\230\370\256\025\204\002\347\270\207\247d\244mw\026\010\016\271#\302h&h{\001\2378\3618\304Q\340p\253\021&\201{\3178\361\266\253V\303\213bQ-\026vma\357\024\314d\265\223XXu\272\033\213\310\013\232\273^\243\3419\211/\372SQ\323h\213,\321\262\003\353\213\005\027\274@\360&.\034\332~\302\357\333\236\017\374\"$ -\313\205\221\007\231\027\206\211b\341!\316a~\307\242\005P\000\256pZ\325\3616lX\235\210\037za2\361\332\ry<\306K\327\340\005\267b\373\220(\016\310\2649p\222(\342\201\230\260Q\253\207\221\250\216\r\340\261\010g\357'\302G\201\313{\326x4~[p0L\0049P'\016\343o\354\236\327N\332V\220\264\353\000\267\230\215b\341\t\274\265\306\220\236D\341\241\207\240\302+RK6M8\236\364\r\362\317\213\005c\017\330\017\340s\3076.\273^d\342\332'\313\204\2453\321B\324\325\355\230n\212\326\214\006\336\363b\361\354\340\376\255;\305\233\325?\272^l\327}\316\003\032\233\216\027\217Wn\020Z.o\330\210\223\305X\304\335\304\341\214Y.p\0326\202[\210\366\241g\373\220:^\340\t\306\212\005\223A\360.\356\372\236\340;[[[q\344l\271aG\260N\350\373\211a\227\325\247\371\2745[V;\375\336\357\306\031\024\207I\344\360?\024\013\302k\363X\330\355\316NaV\003\263Uu\352\227\323\027\2550`\354G\262\230\013<\026\213\245\035\030\022\354{\336g&v\254c{\321\234\334\361\303\2303\267\316\2340\010\300\256\027\006\361\274\330\204\220e\3051\0064'nr\261\360\014Y\007x\014A\213<>\257\217Jyn\033\360\2433\357\307\016\233\323\371\227\224\310s[\200\361\020u\376\004\001\317\222&\233\316\2225\023\234aj\"\252\367\005\217!\216\020g\357\005\237\034wx\324\010\2436\243\372\234\234M/1\327s\004\251\350\341\177\227\326\217yO<""\345\215\203G\337\354=\377\353\343=\366\354\340\236\035;v\334\017\034/\254:a\204\252A'\212\353T^f`1\024\325y\323\013\014\3401\352\267\234q\034\037\217\230\0270\021\331\016\257\333\340`A\324\260\244]v\202I\200\3768\013 :c\266\342\001\214\361Eq\315:\003\243dd\342\205\223\010\326\366\234\010\226\240\314\215\251\306\350\037\260\233HV\263D\032S\020\350\205[\207;T~\231\330\214\006\036\352\256\003%\2468P\244\236\023\317-\253\323\367\357\254\235wK\252\263%\007p\027u\013\000\3143\026\330\010&\233\326\031-p\303\264/(\016#\027l\325\373\343\006\213\021\316P.Q\034}\257>\237\376\235\260c\300\0335S\032&\037\240l\203\312\235/\337\205\315\247\323\317t`\246D\237\314\250ZR\302A\003:$\313\010\244\345\241\240>Mh\272\211\355\217\021\315:\365\231r\237\036\360\336x\323\211h\214\361\013\375C\216\t\255\236\332\tJ\323\267\243\230\373\250\027\214\215\037W\366l\207\027\263\re\264i$\031\265Xe_\217\271\366\302\026\264\032|*\360\263}\247\305\333\375X\264q_P\211\260i\362Mz\232\341*\376\342\377\374{Y{SzU\177}\376\265{\362\364\333\323|i\360H~\253.\202\320\032\3349Y\266tN\227\351\370\317r\212(\222+\362+""\351\252\237\201\217\034\251\375\205\252\251}\002\261\253Ki-\335\247k\277\221\253\2626\025\216\362\353\322S]\275\224\302\3117+\347\n%\350\001\363s\020H\363\013UV?\037\353\274\251\266U\355\024a\271-_\350\262\256\214\362k\362@m\202\0007\305\346\262\374\023(\315\257\310\353\262\245\352:7\245p\351\177!p.\017J\203\207\362\241\252\301\313\274\311\256\315\223\315[\210\221;\274y\274}\014@\253\362\367\372=]\311\022\210^\334\320\007\351\325\341\375\343\312i\376\243\201\003\330\273\340\3576\021^\226e\350w42\361\262\374\213~_\003\357'\312\323]$\216\021\302\203\217\001\271\002k\347\317-]\003\242\322U\205<\2748\270\003\206\3559nK\203\007\362\327*\247.\253\277!\233\237\352$\255\221\322]u\001\254\302\237E\252W\211_\002F\252\226\215\257+\262B\2266\244\215\tA\310\314\\Q\250\210\r\331}\207\235\231\21636\361\210\316j\362\237\372C\242\235\226L\357\245\345\267OO\326>O?L\237\017\217\216\355\343\354\311sT\346^\2721\314\r\313\013\016V\345\327\252Bd\230Z\"\257+\224\031\353p\035\221Y\372/\370\330\220\211z\010\351\263\364Fz4\264\207\335I\257@E\323u\213\234\323\215\364.\212q\034N\202\332W\357\253\355\321\362\032\222\246e2s\331`\2744\370\217\372\014\221\\^\225;\352;\375\225\346h\013\227\021\275\321\307\025\312O8\270\266\211\207\024\320\231\317\205e\344\331g\010\361\247\352\231\276\256m\035\001\336{hS\363uI\211}\305\3448\002q^55\342\215\304>Y\277\231\226)\327\263\222^\032\027\363\272:$J/\rz\262\013W\277\006\326/\365\363\264\37327\372\2408\370\245\334\377\001z\264\242`"; - PyObject *data = __Pyx_DecompressString(cstring, 1874, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (1935 bytes) */ +const char* const cstring = "x\332\245UKs\033\307\021\026\374\220\000\0104\t>\345\210\261\026\261\024[I\004\232\266\022+\254<\n\022\251G\022+\202L9\211R\311\324`w\000Ly\261\013\354\314\222\200r\321\021\3079\316q\216{\304\221G\035u\344\021G\376\004\375\004w\017v\001X\204\252R\t\013\234W\317\364\343\353\257{\357\372\241\373\275\333\246\207\220\210y\261\313\010q<\010\337\202\024\334\002\022\034q\352\203\324\345\001\227\204\210\236\317%\333\333\331\331\021\221\273\343\205]I\272\241\357\307\026j\322\230\222{g\266\254v\007\375\337M\350$\3028r\331\037f50[U\247\016\270\003\331\016\003B~$\023LBPr\261\264\013\272%\371\236\r\210\315\035\351R\036\315\311]?\024\214x\r\342\206A\000\230\3620\020\363b\233B\222\026\307$\2069q\213\311\205g\300:\210\210@\252\"\316\346\365a)\317m\003v|\356\375\304a{:\377\022\211<\267\205`8\344\232ae\"\221,I,\301\236@\342\221_x\232\222(\235\360n\272<\217\350Lp\016\316LD\005Az\271>\025\";k\014$\023\360$\002&\360\027,;\356\262\250\031F\035\322""\2369Q\235^\"\036w%\252\355\303\377>\256\037\263\276|\312\232\207\217\2769x\376\327\307\007\344\331\341\275)U\347\255R\341R1\010\\\036V\3350\202\032\204\276&\032X\254v \002\2647X\213\007\026\276\t\206oy\350\272><\"< 2\242.kP@t\001\007`\211\273\364\004&\t\311\024)\035\240\317\246+\026\2001\266\210%i\237!\022\342 \362\205\033K\322\341n\004\226@\231'0$\374\007,Z\020\247]B\035`J\361\205\327\000w\260\204S\261\035mxP\256]Pb\253\013\n\235\273bnY\235\276\177g\361\275[R\235-\031\004\356A\271C\000,\"\031\217Y\237A\030\314\366\022\001\247},\372f\024vHWF8\267Y\037'\231\245\256\031\007.\334\260c\006\216\007\2758[c\373\266\024\231\326\321\371\342\301\227)\037\355U\260\301\275\276m\226<\200\254J\002\212\246d\340\022:PG`\231\021\322\201Hp\354\303\217@o\316&\350\321\270\264\375\240\303\322<\314\202\207\217%\001\023$\233I'\364b\037\314\023\022PH&\231V-.\340\206\375\234\202\3420\362\000\255\306`\322\244a\004g\220K\230G\2377\346k\242\033vm\360V\315\024\206\354s\226n\240\017\3147\203\205\255\254;Hu\300\214D\317f(oT\302\000\006h\261$\005\020\227G\022\333;F\323\213\251?\211h\326\340\317\365\205\351\001\353O6\335\010G\001\277\320?b0\301\027\002\233\023\224\246O#\301|\250\027\030\233?.\367\331\016^\3146\310h\333qRha\225~t\346\372\020Y\320\223\340[\003?\352\273m\326\031\010\331\201\373\022K\204L\311'\007]&\2626i\001\023_\374\237\177/ko\212\027\n\305qiC\375\333\354\232\375\2440*\217*\343\322\362\360X\271\272<^)\217K+\352\222\352\353\330\324\314w\311\227\311\277N\256\2374^]z\325{\235;\003QN\225\317\362\313C\251v_\326\306\3715\265{\226\307\303\253z\337\\2\275\261\335\\3\037\230\007\311\356\370\234\344\264|\035L\346&\202\237\350\333\2727\267D\265=Tzyx{\330\033\227V\325\2574\035\227W\337\344/\024>\321\3770\255\244\236\320q\376\232\226f\017\227g\371m\375\310\324\321\337\334\270t\003WK\331\357\243aK\325\025\\\331RR\357\231\272\241\023\265BUR\305h\272tZ\372\251\256\277m\022\335\276\0059\362F7OvO \2405\365{\363\236\251\244\004\302\0277\314arut\377\244r\226\377h\350B\330\373\200\337m\004\274\254\312\240\3375\300\304u\365\027\363\276\201x?\321\334\364\2008V\010\036|\014!W\300\332\305\013K\327 \242\322U\r<\274<\274\003\010\3239lK\303\007\352\327:\247\327\365\337\200\315OM\234\324P\351\276\276\004\250\202?\213T\257!\276\030\030\252Z\261\276\256\252\nZ\332R\024&HBj\346\212\206\212\330R\275w\330\231\3518g\023\036\341YM\375\323|\210\260\343\222\230\203\244\374\366\351\351\306\347\311\207\311\363\321\361\t=I\237<\207\312\027V\200g\237A\212?\325\317\314uCM\004\341\275\007mj\276.\221\330W,\307!\021\027u\313@\276\201\330\247\2337\2232r=-\351\245I1o\352#\204ty\330W=p\365k\210\365K\363<\261\325\271<\214\201g\266~\256c^7\241J+\323\035\332)#;\326U=\235^\346\306\037\024\207\277T\365\037\000\001\035\326j"; + PyObject *data = __Pyx_DecompressString(cstring, 1935, 1); if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error) const char* const bytes = __Pyx_PyBytes_AsString(data); #if !CYTHON_ASSUME_SAFE_MACROS if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) } #endif - #else /* compression: none (3758 bytes) */ -const char* const bytes = "Blockchain already has a genesis block. Either it was created or loaded.Blockchain was already loadedCould not allocate hasmapCould not allocate vectorCould not mine block. No nonce foundCreate a genesis block first.\n\tData:\t\tData must be a stringDifficulty must be greater than 0Difficulty must be integer valueFailed to hash dataGenesis Block\n\tHash:\t\t: Hash mismatch. Hash of previous block does not match the saved one in the current block. Abort.: Hashes to not match. Abort.Index Index value is out of boundsMaximum number must be greater than 0\n\tPrev Hash:\tProvided index not foundPyBlock(\n\tIndex:\t\tThe parent directory of the provided database path does not existUTF-8\n).?disableenablegcisenabledno default __reduce__ due to non-trivial __cinit__\n\tnonce:\t\tsqlite:///src/dopt_pollublock_blockchain/blockchain.pyx\n\ttimestamp:\tBlockchainBlockchain.__reduce_cython__Blockchain.__setstate_cython__Blockchain._print_key_value_pairBlockchain.close_db_connectionsBlockchain.create_genesis_blockBlockchain.get_blockBlockchain.get_saving_entriesBlockchain.loadBlockchain.new_blockBlockchain.print_blocksBlockchain.saveBlockchain.validatePathPyBlockPyBlock.__reduce_cython__PyBlock.__setstate_cython__PyBlock.bytes_serializePyBlock.perform_hashPyBlock.serialize_dict__Pyx_PyDict_NextRefTIMEZONE_UTCascasyncio.coroutinesbatchbatch_sizebeginblockblocksbytes_serializeccline_in_tracebackclose_db_connectionsconconnconnectcontentscreate_allcreate_enginecreate_genesis_blockcurrent_time_tzcut_microsecondsdatadata_digestdata_strdatetimedbdb_pathdigestdigest_sizedisposedopt_basicsdopt_basics.datetimedopt_pollublock_blockchaindopt_pollublock_blockchain.blockchainencode__enter__entriesexecuteexists__exit__from_ptrfromhexfromtimestampfunc__func__genesis_donegenesis_prev_hashget_blockget_saving_entries__getstate__hashhexidxindexinsert_is_coroutineititemsload__main__maxmax_nummax_nummbermax_valuemetadata_blockchainmin_idx_min_idx__module____name__new_blocknew_idxnoncenum""order_byparentpartitionspathlibperform_hashpopprev_blockprev_hashprevious_hashprintprint_blocks_print_key_value_pairpy_blockpy_bytespy_bytes_rehashed__pyx_state__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____repr__resresolveresultsavescalarselectselfserialize_dictserialize_resserialize_size__set_name__setdefault__setstate____setstate_cython__sqlsqlalchemystmt__test__timestampvalidatevalues0000000000000000000000000000000000000000000000000000000000000000\200A\360\n\000\t\n\330\014\025\220^\2401\240D\250\t\260\021\260!\330\014\017\210w\220c\230\021\330\020\021\330\014\020\220\007\220x\230u\240A\240V\2502\250]\270$\270b\300\007\300q\310\001\340\014\020\220\001\220\021\340\010\017\210t\2201\200A\330\010\023\2201\340\010\020\220\001\220\033\230D\240\007\240q\330\010\020\220\001\220\037\240\004\240G\2501\330\010\020\220\001\220\033\230D\240\007\240q\330\010\020\220\001\320\021$\240D\250\001\330\010\020\220\001\220\032\2304\230q\330\010\020\220\001\220\032\2304\230q\340\010\017\210q\200A\330\010\013\2104\210q\330\014\022\220,\230a\330\021\022\360\010\000\t\036\230Y\240g\250Q\250a\330\010\037\230t\240:\250Q\250a\340\010\034\230I\240Q\330\014\020\220\001\330\014%\240Q\330\014\r\330\014\r\330\014\r\330\014\016\210g\220Q\220a\340\010\027\220t\230:\240Q\240a\330\010\013\2104\210s\220!\330\014\022\220,\230a\230q\330\010\014\320\014\035\230Q\200A\330\010\013\2104\210q\330\014\022\220,\230a\230q\340\r\021\220\030\230\030\240\026\240q\330\014\022\220#\220X\230Q\230c\240\027\250\001\250\022\2508\2609\270A\270R\270w\300b\310\006\310d\320RS\340\010\014\210I\220S\230\013\2401\240A\330\014\020\320\020 \240\001\240\021\340\010\014\210K\220q\200A\330\010\013\2104\210r\220\022\2203\220d\230\"\230D\240\001\330\014\022\220*\230A\230Q\340\010\034\230D\240\014\250A\250Q\330\010\013\2106\220\023\220A\330\014\022\220*\230A\230Q\330\010\026\220i\230q\240\r\250Q\200A\360\022\000\t\014\2104\210t\2201\330\014\022\220,\230a\230q\330\010\013\2104\210z\230\021\230&\240\001\330\014""\022\220)\2301\230A\340\010\023\2204\220z\240\021\240!\330\010\025\220T\230\034\240Q\240d\250!\330\010\024\220J\230a\330\010\022\220$\220h\230b\240\001\340\010\034\230I\240Q\330\014\r\330\014%\240Q\330\014\r\330\014\r\330\014\r\330\014\016\210g\220Q\220a\340\010\027\220t\230:\240Q\240a\330\010\013\2104\210s\220!\330\014\022\220,\230a\230q\340\010\017\210t\2201\200A\330\010\014\210H\220H\230A\200A\360\010\000\t\n\330\014\034\320\034-\250Q\250d\260)\2701\270A\330\014\023\220=\240\002\240!\340\014\020\220\001\220\021\200A\330\010%\240T\250\033\260F\270!\340\010\016\210c\220\023\220D\230\013\2404\240q\330\014\021\220\021\220,\230c\240\021\330\014\024\220L\240\003\2401\330\014\036\230i\240q\250\001\330\014\021\220\021\220!\330\014\031\230\021\230!\200A\360\006\000\r\037\230a\330\014\033\2301\340\010\013\2108\2203\220a\330\014\022\220*\230A\230Q\340\010\014\210G\2205\230\001\230\024\230W\240A\240R\240u\250A\330\014\024\220D\230\007\230q\240\002\240!\2401\330\014\036\230i\240q\250\001\330\014\021\220\021\220!\330\014\023\2201\330\014\017\210t\2203\220a\330\020\021\200A\330\010\022\220!\360\006\000\r\027\220a\360\006\000\t\014\2108\2203\220a\330\014\030\230\001\340\014\027\220q\340\010\014\210G\2205\230\001\230\024\230W\240A\240R\240u\250A\330\014\017\210t\2203\220a\330\020\021\330\014\024\220D\230\007\230q\240\002\240!\2401\330\014\027\220q\330\014\024\220A\220[\240\005\240Q\330\014\024\220A\220_\240E\250\021\330\014\024\220A\220[\240\005\240Q\330\014\024\220A\320\025(\250\005\250Z\260w\270a\270q\330\014\024\220A\220Z\230u\240E\250\027\260\001\260\021\330\014\024\220A\220Z\230u\240E\250\027\260\001\260\021\330\014\023\2207\230!\2301\340\010\017\210q\200A\360\006\000\r!\240\001\330\014\026\220a\360\010\000\t\r\210G\2205\230\001\230\024\230W\240A\240R\240u\250A\330\014\024\220D\230\007\230q\240\002\240!\2401\330\014\027\220u\230H\240A\240U\250%\250w\260a\260q\330\014\025\220^\2401\240G\2501\250A\330\014 \240\005\240Q\240f\250B\250a\330\014\020\220\001\220\021\330\014\017""\210y\230\003\2301\330\020\025\220Q\220h\230a\230q\330\020\027\220q\330\014\017\210{\230'\240\021\330\020\023\220:\230V\2403\240e\2501\330\024\031\230\021\330\031!\240\021\240!\360\006\000\025\034\2301\330\014\031\230\021\340\010\017\210q\200A\360\006\000\t\020\210s\220'\230\021\230#\230U\240$\240a\240r\250\027\260\002\260!\330\r\021\220\030\230\030\240\026\240q\330\014\025\220T\230\030\240\021\240!\330\014\030\230\006\230g\240Q\340\010\022\220$\320\026)\250\021\250!\330\010\013\2104\210q\330\014\r\340\r\021\220\030\230\026\230v\240Q\330\014\017\210x\220q\230\003\2307\240!\2402\240Z\250q\200\001\330\004\n\210+\220Q"; + #else /* compression: none (3894 bytes) */ +const char* const bytes = "Blockchain already has a genesis block. Either it was created or loaded.Blockchain was already loadedCould not allocate hasmapCould not allocate vectorCould not mine block. No nonce foundCreate a genesis block first.\n\tData:\t\tData must be a stringDifficulty must be greater than 0Difficulty must be integer valueFailed to hash dataGenesis Block\n\tHash:\t\t: Hash mismatch. Hash of previous block does not match the saved one in the current block. Abort.: Hashes to not match. Abort.Index Index value is out of boundsMaximum number must be greater than 0\n\tNonce:\t\t\n\tPrev Hash:\tProvided index not foundPyBlock(\n\tIndex:\t\tThe parent directory of the provided database path does not exist\n\tTimestamp:\tUTF-8\n).?disableenablegcisenabledno default __reduce__ due to non-trivial __cinit__sqlite:///src/dopt_pollublock_blockchain/blockchain.pyxBlockchainBlockchain.__reduce_cython__Blockchain.__setstate_cython__Blockchain._print_key_value_pairBlockchain.close_db_connectionsBlockchain.create_genesis_blockBlockchain.get_blockBlockchain.get_saving_entriesBlockchain.loadBlockchain.new_blockBlockchain.print_blocksBlockchain.saveBlockchain.validateDataHashIndexNoncePathPrevHashPyBlockPyBlockDataPyBlock.__reduce_cython__PyBlock.__setstate_cython__PyBlock.as_dataclassPyBlock.bytes_serializePyBlock.perform_hashPyBlock.serialize_dict__Pyx_PyDict_NextRefTIMEZONE_UTCTimestampas_dataclassascasyncio.coroutinesbatchbatch_sizebeginblockblocksbytes_serializeccline_in_tracebackclose_db_connectionsconconnconnectcontentscreate_allcreate_enginecreate_genesis_blockcurrent_time_tzcut_microsecondsdatadata_digestdata_strdatetimedbdb_pathdigestdigest_sizedisposedopt_basicsdopt_basics.datetimedopt_pollublock_blockchaindopt_pollublock_blockchain.blockchainencode__enter__entriesexecuteexists__exit__from_ptrfromhexfromtimestampfunc__func__genesis_donegenesis_prev_hashget_blockget_saving_entries__getstate__hashhexidxindexinsert_is_coroutineititemsload__main__maxmax_nummax_nummbermax_val""uemetadata_blockchainmin_idx_min_idx__module____name__new_blocknew_idxnoncenumorder_byparentpartitionspathlibperform_hashpopprev_blockprev_hashprevious_hashprintprint_blocks_print_key_value_pairpy_blockpy_bytespy_bytes_rehashed__pyx_state__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____repr__resresolveresultsavescalarselectselfserialize_dictserialize_resserialize_size__set_name__setdefault__setstate____setstate_cython__sqlsqlalchemystmt__test__timestamptypesvalidatevalues0000000000000000000000000000000000000000000000000000000000000000\200A\360\n\000\t\n\330\014\025\220^\2401\240D\250\t\260\021\260!\330\014\017\210w\220c\230\021\330\020\021\330\014\020\220\007\220x\230u\240A\240V\2502\250]\270$\270b\300\007\300q\310\001\340\014\020\220\001\220\021\340\010\017\210t\2201\200A\330\010\023\2201\340\010\020\220\001\220\033\230D\240\007\240q\330\010\020\220\001\220\037\240\004\240G\2501\330\010\020\220\001\220\033\230D\240\007\240q\330\010\020\220\001\320\021$\240D\250\001\330\010\020\220\001\220\032\2304\230q\330\010\020\220\001\220\032\2304\230q\340\010\017\210q\200A\330\010\013\2104\210q\330\014\022\220,\230a\330\021\022\360\010\000\t\036\230Y\240g\250Q\250a\330\010\037\230t\240:\250Q\250a\340\010\034\230I\240Q\330\014\020\220\001\330\014%\240Q\330\014\r\330\014\r\330\014\r\330\014\016\210g\220Q\220a\340\010\027\220t\230:\240Q\240a\330\010\013\2104\210s\220!\330\014\022\220,\230a\230q\330\010\014\320\014\035\230Q\200A\330\010\013\2104\210q\330\014\022\220,\230a\230q\340\r\021\220\030\230\030\240\026\240q\330\014\022\220#\220X\230Q\230c\240\027\250\001\250\022\2508\2609\270A\270R\270w\300b\310\006\310d\320RS\340\010\014\210I\220S\230\013\2401\240A\330\014\020\320\020 \240\001\240\021\340\010\014\210K\220q\200A\330\010\013\2104\210r\220\022\2203\220d\230\"\230D\240\001\330\014\022\220*\230A\230Q\340\010\034\230D\240\014\250A\250Q\330\010\013\2106\220\023\220A\330\014\022\220*\230A\230Q\330\010\026\220i\230q\240\r\250Q\200A\360\022\000\t\014\2104\210t""\2201\330\014\022\220,\230a\230q\330\010\013\2104\210z\230\021\230&\240\001\330\014\022\220)\2301\230A\340\010\023\2204\220z\240\021\240!\330\010\025\220T\230\034\240Q\240d\250!\330\010\024\220J\230a\330\010\022\220$\220h\230b\240\001\340\010\034\230I\240Q\330\014\r\330\014%\240Q\330\014\r\330\014\r\330\014\r\330\014\016\210g\220Q\220a\340\010\027\220t\230:\240Q\240a\330\010\013\2104\210s\220!\330\014\022\220,\230a\230q\340\010\017\210t\2201\200A\330\010\014\210H\220H\230A\200A\360\010\000\t\n\330\014\034\320\034-\250Q\250d\260)\2701\270A\330\014\023\220=\240\002\240!\340\014\020\220\001\220\021\200A\330\010%\240T\250\033\260F\270!\340\010\016\210c\220\023\220D\230\013\2404\240q\330\014\021\220\021\220,\230c\240\021\330\014\024\220L\240\003\2401\330\014\036\230i\240q\250\001\330\014\021\220\021\220!\330\014\031\230\021\230!\200A\360\006\000\r\037\230a\330\014\033\2301\340\010\013\2108\2203\220a\330\014\022\220*\230A\230Q\340\010\014\210G\2205\230\001\230\024\230W\240A\240R\240u\250A\330\014\024\220D\230\007\230q\240\002\240!\2401\330\014\036\230i\240q\250\001\330\014\021\220\021\220!\330\014\023\2201\330\014\017\210t\2203\220a\330\020\021\200A\330\010\022\220!\360\006\000\r\027\220a\360\006\000\t\014\2108\2203\220a\330\014\030\230\001\340\014\027\220q\340\010\014\210G\2205\230\001\230\024\230W\240A\240R\240u\250A\330\014\017\210t\2203\220a\330\020\021\330\014\024\220D\230\007\230q\240\002\240!\2401\330\014\027\220q\330\014\024\220A\220[\240\005\240Q\330\014\024\220A\220_\240E\250\021\330\014\024\220A\220[\240\005\240Q\330\014\024\220A\320\025(\250\005\250Z\260w\270a\270q\330\014\024\220A\220Z\230u\240E\250\027\260\001\260\021\330\014\024\220A\220Z\230u\240E\250\027\260\001\260\021\330\014\023\2207\230!\2301\340\010\017\210q\200A\360\006\000\r!\240\001\330\014\026\220a\360\010\000\t\r\210G\2205\230\001\230\024\230W\240A\240R\240u\250A\330\014\024\220D\230\007\230q\240\002\240!\2401\330\014\027\220u\230H\240A\240U\250%\250w\260a\260q\330\014\025\220^\2401\240G\2501""\250A\330\014 \240\005\240Q\240f\250B\250a\330\014\020\220\001\220\021\330\014\017\210y\230\003\2301\330\020\025\220Q\220h\230a\230q\330\020\027\220q\330\014\017\210{\230'\240\021\330\020\023\220:\230V\2403\240e\2501\330\024\031\230\021\330\031!\240\021\240!\360\006\000\025\034\2301\330\014\031\230\021\340\010\017\210q\200A\360\006\000\t\020\210s\220'\230\021\230#\230U\240$\240a\240r\250\027\260\002\260!\330\r\021\220\030\230\030\240\026\240q\330\014\025\220T\230\030\240\021\240!\330\014\030\230\006\230g\240Q\340\010\022\220$\320\026)\250\021\250!\330\010\013\2104\210q\330\014\r\340\r\021\220\030\230\026\230v\240Q\330\014\017\210x\220q\230\003\2307\240!\2402\240Z\250q\200A\330\010\017\210u\220L\240\001\330\014\022\220$\220a\330\014\026\220d\230!\330\014\022\220$\220a\330\014\025\220T\230\021\330\014\021\220\024\220Q\330\014\021\220\024\220Q\200\001\330\004\n\210+\220Q"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif PyObject **stringtab = __pyx_mstate->__pyx_string_tab; Py_ssize_t pos = 0; - for (int i = 0; i < 173; i++) { + for (int i = 0; i < 183; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL); if (likely(string) && i >= 36) PyUnicode_InternInPlace(&string); @@ -13729,7 +13991,7 @@ const char* const bytes = "Blockchain already has a genesis block. Either it was stringtab[i] = string; pos += bytes_length; } - for (int i = 173; i < 189; i++) { + for (int i = 183; i < 200; i++) { Py_ssize_t bytes_length = index[i].length; PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length); stringtab[i] = string; @@ -13740,15 +14002,15 @@ const char* const bytes = "Blockchain already has a genesis block. Either it was } } Py_XDECREF(data); - for (Py_ssize_t i = 0; i < 189; i++) { + for (Py_ssize_t i = 0; i < 200; i++) { if (unlikely(PyObject_Hash(stringtab[i]) == -1)) { __PYX_ERR(0, 1, __pyx_L1_error) } } #if CYTHON_IMMORTAL_CONSTANTS { - PyObject **table = stringtab + 173; - for (Py_ssize_t i=0; i<16; ++i) { + PyObject **table = stringtab + 183; + for (Py_ssize_t i=0; i<17; ++i) { #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL); #else @@ -13806,89 +14068,94 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { PyObject* tuple_dedup_map = PyDict_New(); if (unlikely(!tuple_dedup_map)) return -1; { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 145}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_contents}; - __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_serialize_dict, __pyx_mstate->__pyx_kp_b_iso88591_A_1_D_q_G1_D_q_D_4q_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 146}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; + __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_as_dataclass, __pyx_mstate->__pyx_kp_b_iso88591_A_uL_a_d_a_T_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 182}; - PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_serialize_res, __pyx_mstate->__pyx_n_u_serialize_size}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_bytes_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 156}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_contents}; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_serialize_dict, __pyx_mstate->__pyx_kp_b_iso88591_A_1_D_q_G1_D_q_D_4q_4q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 193}; + PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_serialize_res, __pyx_mstate->__pyx_n_u_serialize_size}; + __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_bytes_serialize, __pyx_mstate->__pyx_kp_b_iso88591_A_Qd_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + } + { + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 204}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_digest, __pyx_mstate->__pyx_n_u_digest_size}; - __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_perform_hash, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_wc_xuAV2_b_q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_perform_hash, __pyx_mstate->__pyx_kp_b_iso88591_A_1D_wc_xuAV2_b_q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; - __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 459}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 470}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_it, __pyx_mstate->__pyx_n_u_block, __pyx_mstate->__pyx_n_u_py_block}; - __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_print_key_value_pair, __pyx_mstate->__pyx_kp_b_iso88591_A_T_F_c_D_4q_c_L_1_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_print_key_value_pair, __pyx_mstate->__pyx_kp_b_iso88591_A_T_F_c_D_4q_c_L_1_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 469}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 480}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_max_num, __pyx_mstate->__pyx_n_u_block, __pyx_mstate->__pyx_n_u_max_nummber, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_num, __pyx_mstate->__pyx_n_u_py_block}; - __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_print_blocks, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1_83a_AQ_G5_WARuA_D_q_1_iq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_print_blocks, __pyx_mstate->__pyx_kp_b_iso88591_A_a_1_83a_AQ_G5_WARuA_D_q_1_iq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 486}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 497}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_block}; - __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_get_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4r_3d_D_AQ_D_AQ_6_A_AQ_iq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_get_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4r_3d_D_AQ_D_AQ_6_A_AQ_iq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 495}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 506}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_genesis_prev_hash, __pyx_mstate->__pyx_n_u_data_str, __pyx_mstate->__pyx_n_u_block, __pyx_mstate->__pyx_n_u_res}; - __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_create_genesis_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_a_YgQa_t_Qa_IQ_Q_gQa_t_Qa_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_create_genesis_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_a_YgQa_t_Qa_IQ_Q_gQa_t_Qa_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 518}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 10, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 529}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_data, __pyx_mstate->__pyx_n_u_prev_block, __pyx_mstate->__pyx_n_u_prev_hash, __pyx_mstate->__pyx_n_u_new_idx, __pyx_mstate->__pyx_n_u_data_str, __pyx_mstate->__pyx_n_u_data_digest, __pyx_mstate->__pyx_n_u_digest_size, __pyx_mstate->__pyx_n_u_block, __pyx_mstate->__pyx_n_u_res}; - __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_new_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_aq_4z_1A_4z_T_Qd_Ja_hb_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_new_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_aq_4z_1A_4z_T_Qd_Ja_hb_IQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 551}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 8, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 562}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_block, __pyx_mstate->__pyx_n_u_prev_block, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_digest, __pyx_mstate->__pyx_n_u_digest_size, __pyx_mstate->__pyx_n_u_py_bytes, __pyx_mstate->__pyx_n_u_py_bytes_rehashed}; - __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_validate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_G5_WARuA_D_q_1_uHAU_waq_1G1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_validate, __pyx_mstate->__pyx_kp_b_iso88591_A_a_G5_WARuA_D_q_1_uHAU_waq_1G1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 590}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_min_idx, __pyx_mstate->__pyx_n_u_entries, __pyx_mstate->__pyx_n_u_block, __pyx_mstate->__pyx_n_u_idx, __pyx_mstate->__pyx_n_u_min_idx_2, __pyx_mstate->__pyx_n_u_contents}; - __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_get_saving_entries, __pyx_mstate->__pyx_kp_b_iso88591_A_a_83a_q_G5_WARuA_t3a_D_q_1_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_get_saving_entries, __pyx_mstate->__pyx_kp_b_iso88591_A_a_83a_q_G5_WARuA_t3a_D_q_1_q_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 606}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 617}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_stmt, __pyx_mstate->__pyx_n_u_conn, __pyx_mstate->__pyx_n_u_result, __pyx_mstate->__pyx_n_u_max_value, __pyx_mstate->__pyx_n_u_entries, __pyx_mstate->__pyx_n_u_con}; - __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_save, __pyx_mstate->__pyx_kp_b_iso88591_A_s_U_ar_q_T_gQ_4q_vQ_xq_7_2Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_save, __pyx_mstate->__pyx_kp_b_iso88591_A_s_U_ar_q_T_gQ_4q_vQ_xq_7_2Zq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 621}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 632}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_close_db_connections, __pyx_mstate->__pyx_kp_b_iso88591_A_HHA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_close_db_connections, __pyx_mstate->__pyx_kp_b_iso88591_A_HHA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 624}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 635}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_batch_size, __pyx_mstate->__pyx_n_u_con, __pyx_mstate->__pyx_n_u_res, __pyx_mstate->__pyx_n_u_batch}; - __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_aq_q_XQc_89ARwb_dRS_IS_1A_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_dopt_pollublock_blockchain_b, __pyx_mstate->__pyx_n_u_load, __pyx_mstate->__pyx_kp_b_iso88591_A_4q_aq_q_XQc_89ARwb_dRS_IS_1A_K, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; - __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; } { const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state}; - __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_mstate->__pyx_kp_b_iso88591_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad; } Py_DECREF(tuple_dedup_map); return 0; diff --git a/src/dopt_pollublock_blockchain/blockchain.pyi b/src/dopt_pollublock_blockchain/blockchain.pyi index d4cc79a..3080b95 100644 --- a/src/dopt_pollublock_blockchain/blockchain.pyi +++ b/src/dopt_pollublock_blockchain/blockchain.pyi @@ -12,6 +12,7 @@ class PyBlock: def __init__(self) -> None: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... + def as_dataclass(self) -> t.PyBlockData: ... def serialize_dict(self) -> t.SerializedPyBlock: ... @property def index(self) -> int: ... diff --git a/src/dopt_pollublock_blockchain/blockchain.pyx b/src/dopt_pollublock_blockchain/blockchain.pyx index f5886ea..4f5057b 100644 --- a/src/dopt_pollublock_blockchain/blockchain.pyx +++ b/src/dopt_pollublock_blockchain/blockchain.pyx @@ -11,6 +11,7 @@ import dopt_basics.datetime import sqlalchemy as sql from dopt_pollublock_blockchain import db +from dopt_pollublock_blockchain import types from dopt_pollublock_blockchain.block cimport Block from libcpp.unordered_map cimport unordered_map @@ -135,13 +136,23 @@ cdef class PyBlock: def __repr__(self): return ( - f"PyBlock(\n\tIndex:\t\t{self.index}\n\ttimestamp:\t{self.timestamp}\n\tnonce:\t\t{self.nonce}\n\t" + f"PyBlock(\n\tIndex:\t\t{self.index}\n\tTimestamp:\t{self.timestamp}\n\tNonce:\t\t{self.nonce}\n\t" f"Prev Hash:\t{self.prev_hash}\n\tHash:\t\t{self.hash}\n\tData:\t\t{self.data}\n)" ) def __str__(self): return self.__repr__() + def as_dataclass(self): + return types.PyBlockData( + Index=self.index, + Timestamp=self.timestamp, + Nonce=self.nonce, + PrevHash=self.prev_hash, + Hash=self.hash, + Data=self.data, + ) + def serialize_dict(self): contents = {} diff --git a/src/dopt_pollublock_blockchain/constants.py b/src/dopt_pollublock_blockchain/constants.py index 12c32bc..4a5a430 100644 --- a/src/dopt_pollublock_blockchain/constants.py +++ b/src/dopt_pollublock_blockchain/constants.py @@ -1,5 +1,19 @@ from __future__ import annotations +import random from typing import Final +# ** blockchain +BLOCKCHAIN_LOADING_BATCH_SIZE: Final[int] = 256 BLOCKCHAIN_DIFFICULTY: Final[int] = 24 + +# ** data sampling +RNG_SEED_RANGE: Final[frozenset[str]] = frozenset(str(seed) for seed in range(1, 101)) +RNG_DEFAULT_SEED: Final[int | None] = 42 +RNG: Final[random.Random] = random.Random(RNG_DEFAULT_SEED) +TEMPERATURE_MEAN: Final[float] = 344.224456 +TEMPERATURE_STD: Final[float] = 46.478794 +PRESSURE_MIN: Final[int] = 15587 +PRESSURE_MAX: Final[int] = 15602 +AIRQTY_MEAN: Final[float] = -22.958655 +AIRQTY_STD: Final[float] = 2.101152 diff --git a/src/dopt_pollublock_blockchain/types.py b/src/dopt_pollublock_blockchain/types.py index 1633b2c..3b668bd 100644 --- a/src/dopt_pollublock_blockchain/types.py +++ b/src/dopt_pollublock_blockchain/types.py @@ -1,8 +1,28 @@ +from __future__ import annotations + +import dataclasses as dc +import datetime +import enum from typing import TypeAlias, TypedDict BlockIndex: TypeAlias = int +class ApplicationScenarios(enum.IntEnum): + DATA_VALIDATION = 1 + DATA_GENERATION = 2 + + +@dc.dataclass(slots=True, kw_only=True, eq=False) +class PyBlockData: + Index: int + Timestamp: datetime.datetime + Nonce: int + PrevHash: str + Hash: str + Data: str + + class SerializedPyBlock(TypedDict): index: int timestamp: int @@ -10,3 +30,15 @@ class SerializedPyBlock(TypedDict): previous_hash: str hash: str data: str + + +RandomSampleEntry = TypedDict( + "RandomSampleEntry", + { + "Datetime": datetime.datetime, + "Temperature_(Celsius)": float, + "Pressure_(Pa)": int, + "Air_Quantity_(Percent)": float, + "Blockchain_Block_Number": int | None, + }, +)