From 56be501a79bdaee8e9531fbea3b8fc77aaaedf02 Mon Sep 17 00:00:00 2001 From: foefl Date: Mon, 15 Dec 2025 14:08:40 +0100 Subject: [PATCH] remove prange --- src/polluck_blockchain/placeholder_native.cpp | 748 +++++++----------- src/polluck_blockchain/placeholder_native.pyx | 16 - 2 files changed, 299 insertions(+), 465 deletions(-) diff --git a/src/polluck_blockchain/placeholder_native.cpp b/src/polluck_blockchain/placeholder_native.cpp index f3e51b3..53e8036 100644 --- a/src/polluck_blockchain/placeholder_native.cpp +++ b/src/polluck_blockchain/placeholder_native.cpp @@ -1650,7 +1650,7 @@ struct __pyx_obj_18polluck_blockchain_18placeholder_native_PyBlock { }; -/* "polluck_blockchain/placeholder_native.pyx":355 +/* "polluck_blockchain/placeholder_native.pyx":339 * * * cdef class Blockchain: # <<<<<<<<<<<<<< @@ -1687,7 +1687,7 @@ struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock { static struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *__pyx_vtabptr_18polluck_blockchain_18placeholder_native_PyBlock; -/* "polluck_blockchain/placeholder_native.pyx":355 +/* "polluck_blockchain/placeholder_native.pyx":339 * * * cdef class Blockchain: # <<<<<<<<<<<<<< @@ -2184,19 +2184,9 @@ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) #endif -/* IncludeStdlibH.proto */ -#include - /* ErrOccurredWithGIL.proto */ static CYTHON_INLINE int __Pyx_ErrOccurredWithGIL(void); -/* SharedInFreeThreading.proto */ -#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING -#define __Pyx_shared_in_cpython_freethreading(x) shared(x) -#else -#define __Pyx_shared_in_cpython_freethreading(x) -#endif - /* PyRuntimeError_Check.proto */ #define __Pyx_PyExc_RuntimeError_Check(obj) __Pyx_TypeCheck(obj, PyExc_RuntimeError) @@ -2894,7 +2884,7 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati #define __pyx_kp_b_iso88591_A_IQ_q_Ct3b_7_1_waq_gQa_X_Jaq_Q __pyx_string_tab[97] #define __pyx_kp_b_iso88591_A_T_a_c_D_t1_c_L_1_iq __pyx_string_tab[98] #define __pyx_kp_b_iso88591_A_T_wc_xuAV2_b_q_t1 __pyx_string_tab[99] -#define __pyx_kp_b_iso88591_EQ_q_1_AQ_T_1AQ_1_RRS_AQ_A_T_Qa __pyx_string_tab[100] +#define __pyx_kp_b_iso88591_EQ_q_T_1AQ_aq_BnJa_WA_1A_Q_AQ_4 __pyx_string_tab[100] #define __pyx_kp_b_iso88591_Q __pyx_string_tab[101] #define __pyx_int_0 __pyx_number_tab[0] #define __pyx_int_1 __pyx_number_tab[1] @@ -5623,8 +5613,6 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_mine int __pyx_v_nonce_found; int __pyx_v_nonce; int __pyx_v_nonce_solution; - int *__pyx_v_p_nonce_found; - int *__pyx_v_p_nonce_solution; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -5637,7 +5625,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_mine unsigned char *__pyx_t_8; unsigned int __pyx_t_9; unsigned int __pyx_t_10; - unsigned int __pyx_t_11; + int __pyx_t_11; int __pyx_t_12; int __pyx_t_13; int __pyx_lineno = 0; @@ -5721,7 +5709,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_mine * size_t digest_size * bint nonce_found = False # <<<<<<<<<<<<<< * int nonce, nonce_solution = 0 - * bint *p_nonce_found = &nonce_found + * */ __pyx_v_nonce_found = 0; @@ -5729,267 +5717,129 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_mine * size_t digest_size * bint nonce_found = False * int nonce, nonce_solution = 0 # <<<<<<<<<<<<<< - * bint *p_nonce_found = &nonce_found - * int *p_nonce_solution = &nonce_solution + * + * serial_buf = self.bytes_serialize_c(&serialize_size) */ __pyx_v_nonce_solution = 0; - /* "polluck_blockchain/placeholder_native.pyx":272 - * bint nonce_found = False - * int nonce, nonce_solution = 0 - * bint *p_nonce_found = &nonce_found # <<<<<<<<<<<<<< - * int *p_nonce_solution = &nonce_solution - * -*/ - __pyx_v_p_nonce_found = (&__pyx_v_nonce_found); - /* "polluck_blockchain/placeholder_native.pyx":273 * int nonce, nonce_solution = 0 - * bint *p_nonce_found = &nonce_found - * int *p_nonce_solution = &nonce_solution # <<<<<<<<<<<<<< - * - * serial_buf = self.bytes_serialize_c(&serialize_size) -*/ - __pyx_v_p_nonce_solution = (&__pyx_v_nonce_solution); - - /* "polluck_blockchain/placeholder_native.pyx":275 - * int *p_nonce_solution = &nonce_solution * * serial_buf = self.bytes_serialize_c(&serialize_size) # <<<<<<<<<<<<<< * - * for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): + * with nogil: */ - __pyx_t_8 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->bytes_serialize_c(__pyx_v_self, (&__pyx_v_serialize_size)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_8 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->bytes_serialize_c(__pyx_v_self, (&__pyx_v_serialize_size)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L1_error) __pyx_v_serial_buf = __pyx_t_8; - /* "polluck_blockchain/placeholder_native.pyx":277 + /* "polluck_blockchain/placeholder_native.pyx":275 * serial_buf = self.bytes_serialize_c(&serialize_size) * - * for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): # <<<<<<<<<<<<<< - * if p_nonce_found[0]: - * break + * with nogil: # <<<<<<<<<<<<<< + * for nonce in range(max_nonce): + * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) */ { PyThreadState * _save; _save = PyEval_SaveThread(); __Pyx_FastGIL_Remember(); /*try:*/ { + + /* "polluck_blockchain/placeholder_native.pyx":276 + * + * with nogil: + * for nonce in range(max_nonce): # <<<<<<<<<<<<<< + * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) + * digest = self.digest(serial_buf, serialize_size, &digest_size) +*/ __pyx_t_9 = __pyx_v_max_nonce; - { - const char *__pyx_parallel_filename = NULL; int __pyx_parallel_lineno = 0, __pyx_parallel_clineno = 0; - PyObject *__pyx_parallel_exc_type = NULL, *__pyx_parallel_exc_value = NULL, *__pyx_parallel_exc_tb = NULL; - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyMutex __pyx_parallel_freethreading_mutex = {0}; - #endif - int __pyx_parallel_why; - __pyx_parallel_why = 0; - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) (x) - #define unlikely(x) (x) - #endif - __pyx_t_11 = (__pyx_t_9 - 0 + 1 - 1/abs(1)) / 1; - if (__pyx_t_11 > 0) - { - #ifdef _OPENMP - #pragma omp parallel num_threads(16) private(__pyx_t_12, __pyx_t_13, __pyx_t_8) __Pyx_shared_in_cpython_freethreading(__pyx_parallel_freethreading_mutex) private(__pyx_filename, __pyx_lineno, __pyx_clineno) shared(__pyx_parallel_why, __pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb) - #endif /* _OPENMP */ - { - #ifdef _OPENMP - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - Py_BEGIN_ALLOW_THREADS - #endif /* _OPENMP */ - #ifdef _OPENMP - #pragma omp for firstprivate(__pyx_v_digest) lastprivate(__pyx_v_digest) firstprivate(__pyx_v_nonce) lastprivate(__pyx_v_nonce) schedule(static) - #endif /* _OPENMP */ - for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_11; __pyx_t_10++){ - if (__pyx_parallel_why < 2) - { - __pyx_v_nonce = (int)(0 + 1 * __pyx_t_10); + __pyx_t_10 = __pyx_t_9; + for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) { + __pyx_v_nonce = __pyx_t_11; - /* "polluck_blockchain/placeholder_native.pyx":278 - * - * for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): - * if p_nonce_found[0]: # <<<<<<<<<<<<<< - * break + /* "polluck_blockchain/placeholder_native.pyx":277 + * with nogil: + * for nonce in range(max_nonce): + * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) # <<<<<<<<<<<<<< + * digest = self.digest(serial_buf, serialize_size, &digest_size) * */ - if ((__pyx_v_p_nonce_found[0])) { + __pyx_t_12 = __pyx_f_18polluck_blockchain_18placeholder_native_serialize_uint64((__pyx_v_serial_buf + __pyx_v_18polluck_blockchain_18placeholder_native_NONCE_OFFSET), ((uint64_t)__pyx_v_nonce)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 277, __pyx_L4_error) - /* "polluck_blockchain/placeholder_native.pyx":279 - * for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): - * if p_nonce_found[0]: - * break # <<<<<<<<<<<<<< + /* "polluck_blockchain/placeholder_native.pyx":278 + * for nonce in range(max_nonce): + * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) + * digest = self.digest(serial_buf, serialize_size, &digest_size) # <<<<<<<<<<<<<< * - * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) + * if has_leading_zero_bits(digest, difficulty): */ - goto __pyx_L7_break; + __pyx_t_8 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->digest(__pyx_v_self, __pyx_v_serial_buf, __pyx_v_serialize_size, (&__pyx_v_digest_size)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 278, __pyx_L4_error) + __pyx_v_digest = __pyx_t_8; - /* "polluck_blockchain/placeholder_native.pyx":278 + /* "polluck_blockchain/placeholder_native.pyx":280 + * digest = self.digest(serial_buf, serialize_size, &digest_size) * - * for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): - * if p_nonce_found[0]: # <<<<<<<<<<<<<< - * break + * if has_leading_zero_bits(digest, difficulty): # <<<<<<<<<<<<<< + * nonce_found = True + * nonce_solution = nonce +*/ + __pyx_t_13 = __pyx_f_18polluck_blockchain_18placeholder_native_has_leading_zero_bits(__pyx_v_digest, __pyx_v_difficulty); if (unlikely(__pyx_t_13 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 280, __pyx_L4_error) + if (__pyx_t_13) { + + /* "polluck_blockchain/placeholder_native.pyx":281 + * + * if has_leading_zero_bits(digest, difficulty): + * nonce_found = True # <<<<<<<<<<<<<< + * nonce_solution = nonce + * break +*/ + __pyx_v_nonce_found = 1; + + /* "polluck_blockchain/placeholder_native.pyx":282 + * if has_leading_zero_bits(digest, difficulty): + * nonce_found = True + * nonce_solution = nonce # <<<<<<<<<<<<<< + * break * */ - } + __pyx_v_nonce_solution = __pyx_v_nonce; - /* "polluck_blockchain/placeholder_native.pyx":281 - * break - * - * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) # <<<<<<<<<<<<<< - * digest = self.digest(serial_buf, serialize_size, &digest_size) + /* "polluck_blockchain/placeholder_native.pyx":283 + * nonce_found = True + * nonce_solution = nonce + * break # <<<<<<<<<<<<<< * + * free(digest) */ - __pyx_t_12 = __pyx_f_18polluck_blockchain_18placeholder_native_serialize_uint64((__pyx_v_serial_buf + __pyx_v_18polluck_blockchain_18placeholder_native_NONCE_OFFSET), ((uint64_t)__pyx_v_nonce)); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 281, __pyx_L8_error) + goto __pyx_L7_break; - /* "polluck_blockchain/placeholder_native.pyx":282 + /* "polluck_blockchain/placeholder_native.pyx":280 + * digest = self.digest(serial_buf, serialize_size, &digest_size) * - * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) - * digest = self.digest(serial_buf, serialize_size, &digest_size) # <<<<<<<<<<<<<< - * - * if has_leading_zero_bits(digest, difficulty): + * if has_leading_zero_bits(digest, difficulty): # <<<<<<<<<<<<<< + * nonce_found = True + * nonce_solution = nonce */ - __pyx_t_8 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->digest(__pyx_v_self, __pyx_v_serial_buf, __pyx_v_serialize_size, (&__pyx_v_digest_size)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 282, __pyx_L8_error) - __pyx_v_digest = __pyx_t_8; + } - /* "polluck_blockchain/placeholder_native.pyx":284 - * digest = self.digest(serial_buf, serialize_size, &digest_size) + /* "polluck_blockchain/placeholder_native.pyx":285 + * break * - * if has_leading_zero_bits(digest, difficulty): # <<<<<<<<<<<<<< - * p_nonce_found[0] = True - * p_nonce_solution[0] = nonce + * free(digest) # <<<<<<<<<<<<<< + * + * if not nonce_found: */ - __pyx_t_13 = __pyx_f_18polluck_blockchain_18placeholder_native_has_leading_zero_bits(__pyx_v_digest, __pyx_v_difficulty); if (unlikely(__pyx_t_13 == ((int)-1) && __Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 284, __pyx_L8_error) - if (__pyx_t_13) { - - /* "polluck_blockchain/placeholder_native.pyx":285 - * - * if has_leading_zero_bits(digest, difficulty): - * p_nonce_found[0] = True # <<<<<<<<<<<<<< - * p_nonce_solution[0] = nonce - * break -*/ - (__pyx_v_p_nonce_found[0]) = 1; - - /* "polluck_blockchain/placeholder_native.pyx":286 - * if has_leading_zero_bits(digest, difficulty): - * p_nonce_found[0] = True - * p_nonce_solution[0] = nonce # <<<<<<<<<<<<<< - * break - * -*/ - (__pyx_v_p_nonce_solution[0]) = __pyx_v_nonce; - - /* "polluck_blockchain/placeholder_native.pyx":287 - * p_nonce_found[0] = True - * p_nonce_solution[0] = nonce - * break # <<<<<<<<<<<<<< - * - * free(digest) -*/ - goto __pyx_L7_break; - - /* "polluck_blockchain/placeholder_native.pyx":284 - * digest = self.digest(serial_buf, serialize_size, &digest_size) - * - * if has_leading_zero_bits(digest, difficulty): # <<<<<<<<<<<<<< - * p_nonce_found[0] = True - * p_nonce_solution[0] = nonce -*/ - } - - /* "polluck_blockchain/placeholder_native.pyx":289 - * break - * - * free(digest) # <<<<<<<<<<<<<< - * - * # with nogil: -*/ - free(__pyx_v_digest); - goto __pyx_L13; - __pyx_L7_break:; - __pyx_parallel_why = 2; - goto __pyx_L13; - __pyx_L8_error:; - { - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyMutex_Lock(&__pyx_parallel_freethreading_mutex); - #endif - #ifdef _OPENMP - #pragma omp flush(__pyx_parallel_exc_type) - #endif /* _OPENMP */ - if (!__pyx_parallel_exc_type) { - __Pyx_ErrFetchWithState(&__pyx_parallel_exc_type, &__pyx_parallel_exc_value, &__pyx_parallel_exc_tb); - __pyx_parallel_filename = __pyx_filename; __pyx_parallel_lineno = __pyx_lineno; __pyx_parallel_clineno = __pyx_clineno; - __Pyx_GOTREF(__pyx_parallel_exc_type); - } - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyMutex_Unlock(&__pyx_parallel_freethreading_mutex); - #endif - __Pyx_PyGILState_Release(__pyx_gilstate_save); - } - __pyx_parallel_why = 4; - goto __pyx_L13; - __pyx_L13:; - #ifdef _OPENMP - #pragma omp flush(__pyx_parallel_why) - #endif /* _OPENMP */ - } - } - #ifdef _OPENMP - Py_END_ALLOW_THREADS - #else -{ -PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #endif /* _OPENMP */ - /* Clean up any temporaries */ - __Pyx_PyGILState_Release(__pyx_gilstate_save); - #ifndef _OPENMP -} -#endif /* _OPENMP */ - } - } - if (__pyx_parallel_exc_type) { - /* This may have been overridden by a continue, break or return in another thread. Prefer the error. */ - __pyx_parallel_why = 4; - } - if (__pyx_parallel_why) { - switch (__pyx_parallel_why) { - case 4: - { - PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyMutex_Lock(&__pyx_parallel_freethreading_mutex); - #endif - __Pyx_GIVEREF(__pyx_parallel_exc_type); - __Pyx_ErrRestoreWithState(__pyx_parallel_exc_type, __pyx_parallel_exc_value, __pyx_parallel_exc_tb); - __pyx_filename = __pyx_parallel_filename; __pyx_lineno = __pyx_parallel_lineno; __pyx_clineno = __pyx_parallel_clineno; - #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING - PyMutex_Unlock(&__pyx_parallel_freethreading_mutex); - #endif - __Pyx_PyGILState_Release(__pyx_gilstate_save); - } - goto __pyx_L4_error; - } - } + free(__pyx_v_digest); } - #if ((defined(__APPLE__) || defined(__OSX__)) && (defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))))) - #undef likely - #undef unlikely - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) - #endif + __pyx_L7_break:; } - /* "polluck_blockchain/placeholder_native.pyx":277 + /* "polluck_blockchain/placeholder_native.pyx":275 * serial_buf = self.bytes_serialize_c(&serialize_size) * - * for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): # <<<<<<<<<<<<<< - * if p_nonce_found[0]: - * break + * with nogil: # <<<<<<<<<<<<<< + * for nonce in range(max_nonce): + * serialize_uint64(serial_buf + NONCE_OFFSET, nonce) */ /*finally:*/ { /*normal exit:*/{ @@ -6006,8 +5856,8 @@ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); } } - /* "polluck_blockchain/placeholder_native.pyx":303 - * # free(digest) + /* "polluck_blockchain/placeholder_native.pyx":287 + * free(digest) * * if not nonce_found: # <<<<<<<<<<<<<< * raise RuntimeError("No valid nonce found") @@ -6016,7 +5866,7 @@ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); __pyx_t_13 = (!__pyx_v_nonce_found); if (unlikely(__pyx_t_13)) { - /* "polluck_blockchain/placeholder_native.pyx":304 + /* "polluck_blockchain/placeholder_native.pyx":288 * * if not nonce_found: * raise RuntimeError("No valid nonce found") # <<<<<<<<<<<<<< @@ -6029,15 +5879,15 @@ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_No_valid_nonce_found}; __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_RuntimeError)), __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __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, 304, __pyx_L1_error) + __PYX_ERR(0, 288, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":303 - * # free(digest) + /* "polluck_blockchain/placeholder_native.pyx":287 + * free(digest) * * if not nonce_found: # <<<<<<<<<<<<<< * raise RuntimeError("No valid nonce found") @@ -6045,7 +5895,7 @@ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure(); */ } - /* "polluck_blockchain/placeholder_native.pyx":306 + /* "polluck_blockchain/placeholder_native.pyx":290 * raise RuntimeError("No valid nonce found") * * self.BlockC.nonce = nonce_solution # <<<<<<<<<<<<<< @@ -6211,7 +6061,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_7PyBlock_12m return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":308 +/* "polluck_blockchain/placeholder_native.pyx":292 * self.BlockC.nonce = nonce_solution * * cdef unsigned char* perform_hash_c(self, size_t *digest_size) nogil: # <<<<<<<<<<<<<< @@ -6231,17 +6081,17 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock int __pyx_clineno = 0; PyGILState_STATE __pyx_gilstate_save; - /* "polluck_blockchain/placeholder_native.pyx":314 + /* "polluck_blockchain/placeholder_native.pyx":298 * unsigned char *digest * * serialize_res = self.bytes_serialize_c(&serialize_size) # <<<<<<<<<<<<<< * if serialize_res == NULL: * return NULL */ - __pyx_t_1 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->bytes_serialize_c(__pyx_v_self, (&__pyx_v_serialize_size)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->bytes_serialize_c(__pyx_v_self, (&__pyx_v_serialize_size)); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 298, __pyx_L1_error) __pyx_v_serialize_res = __pyx_t_1; - /* "polluck_blockchain/placeholder_native.pyx":315 + /* "polluck_blockchain/placeholder_native.pyx":299 * * serialize_res = self.bytes_serialize_c(&serialize_size) * if serialize_res == NULL: # <<<<<<<<<<<<<< @@ -6251,7 +6101,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock __pyx_t_2 = (__pyx_v_serialize_res == NULL); if (__pyx_t_2) { - /* "polluck_blockchain/placeholder_native.pyx":316 + /* "polluck_blockchain/placeholder_native.pyx":300 * serialize_res = self.bytes_serialize_c(&serialize_size) * if serialize_res == NULL: * return NULL # <<<<<<<<<<<<<< @@ -6261,7 +6111,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock __pyx_r = NULL; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":315 + /* "polluck_blockchain/placeholder_native.pyx":299 * * serialize_res = self.bytes_serialize_c(&serialize_size) * if serialize_res == NULL: # <<<<<<<<<<<<<< @@ -6270,17 +6120,17 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock */ } - /* "polluck_blockchain/placeholder_native.pyx":317 + /* "polluck_blockchain/placeholder_native.pyx":301 * if serialize_res == NULL: * return NULL * digest = self.digest(serialize_res, serialize_size, digest_size) # <<<<<<<<<<<<<< * if digest == NULL: * return NULL */ - __pyx_t_1 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->digest(__pyx_v_self, __pyx_v_serialize_res, __pyx_v_serialize_size, __pyx_v_digest_size); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_1 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->digest(__pyx_v_self, __pyx_v_serialize_res, __pyx_v_serialize_size, __pyx_v_digest_size); if (unlikely(__Pyx_ErrOccurredWithGIL())) __PYX_ERR(0, 301, __pyx_L1_error) __pyx_v_digest = __pyx_t_1; - /* "polluck_blockchain/placeholder_native.pyx":318 + /* "polluck_blockchain/placeholder_native.pyx":302 * return NULL * digest = self.digest(serialize_res, serialize_size, digest_size) * if digest == NULL: # <<<<<<<<<<<<<< @@ -6290,7 +6140,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock __pyx_t_2 = (__pyx_v_digest == NULL); if (__pyx_t_2) { - /* "polluck_blockchain/placeholder_native.pyx":319 + /* "polluck_blockchain/placeholder_native.pyx":303 * digest = self.digest(serialize_res, serialize_size, digest_size) * if digest == NULL: * return NULL # <<<<<<<<<<<<<< @@ -6300,7 +6150,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock __pyx_r = NULL; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":318 + /* "polluck_blockchain/placeholder_native.pyx":302 * return NULL * digest = self.digest(serialize_res, serialize_size, digest_size) * if digest == NULL: # <<<<<<<<<<<<<< @@ -6309,7 +6159,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock */ } - /* "polluck_blockchain/placeholder_native.pyx":321 + /* "polluck_blockchain/placeholder_native.pyx":305 * return NULL * * free(serialize_res) # <<<<<<<<<<<<<< @@ -6318,7 +6168,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock */ free(__pyx_v_serialize_res); - /* "polluck_blockchain/placeholder_native.pyx":323 + /* "polluck_blockchain/placeholder_native.pyx":307 * free(serialize_res) * * return digest # <<<<<<<<<<<<<< @@ -6328,7 +6178,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock __pyx_r = __pyx_v_digest; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":308 + /* "polluck_blockchain/placeholder_native.pyx":292 * self.BlockC.nonce = nonce_solution * * cdef unsigned char* perform_hash_c(self, size_t *digest_size) nogil: # <<<<<<<<<<<<<< @@ -6346,7 +6196,7 @@ static unsigned char *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":325 +/* "polluck_blockchain/placeholder_native.pyx":309 * return digest * * cpdef perform_hash(self): # <<<<<<<<<<<<<< @@ -6404,7 +6254,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) { PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self)); #endif - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_perform_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_perform_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_18polluck_blockchain_18placeholder_native_7PyBlock_15perform_hash)) { __Pyx_XDECREF(__pyx_r); @@ -6428,7 +6278,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__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, 325, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __pyx_r = __pyx_t_2; @@ -6449,7 +6299,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf #endif } - /* "polluck_blockchain/placeholder_native.pyx":330 + /* "polluck_blockchain/placeholder_native.pyx":314 * size_t digest_size * * try: # <<<<<<<<<<<<<< @@ -6458,17 +6308,17 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf */ /*try:*/ { - /* "polluck_blockchain/placeholder_native.pyx":331 + /* "polluck_blockchain/placeholder_native.pyx":315 * * try: * digest = self.perform_hash_c(&digest_size) # <<<<<<<<<<<<<< * if digest == NULL: * raise MemoryError() */ - __pyx_t_6 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->perform_hash_c(__pyx_v_self, (&__pyx_v_digest_size)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L4_error) + __pyx_t_6 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_v_self->__pyx_vtab)->perform_hash_c(__pyx_v_self, (&__pyx_v_digest_size)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 315, __pyx_L4_error) __pyx_v_digest = __pyx_t_6; - /* "polluck_blockchain/placeholder_native.pyx":332 + /* "polluck_blockchain/placeholder_native.pyx":316 * try: * digest = self.perform_hash_c(&digest_size) * if digest == NULL: # <<<<<<<<<<<<<< @@ -6478,16 +6328,16 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf __pyx_t_7 = (__pyx_v_digest == NULL); if (unlikely(__pyx_t_7)) { - /* "polluck_blockchain/placeholder_native.pyx":333 + /* "polluck_blockchain/placeholder_native.pyx":317 * digest = self.perform_hash_c(&digest_size) * if digest == NULL: * raise MemoryError() # <<<<<<<<<<<<<< * self.BlockC.hash = bytes(digest[:digest_size]).hex().encode("UTF-8") * finally: */ - PyErr_NoMemory(); __PYX_ERR(0, 333, __pyx_L4_error) + PyErr_NoMemory(); __PYX_ERR(0, 317, __pyx_L4_error) - /* "polluck_blockchain/placeholder_native.pyx":332 + /* "polluck_blockchain/placeholder_native.pyx":316 * try: * digest = self.perform_hash_c(&digest_size) * if digest == NULL: # <<<<<<<<<<<<<< @@ -6496,7 +6346,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf */ } - /* "polluck_blockchain/placeholder_native.pyx":334 + /* "polluck_blockchain/placeholder_native.pyx":318 * if digest == NULL: * raise MemoryError() * self.BlockC.hash = bytes(digest[:digest_size]).hex().encode("UTF-8") # <<<<<<<<<<<<<< @@ -6504,7 +6354,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf * free(digest) */ __pyx_t_3 = NULL; - __pyx_t_8 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 334, __pyx_L4_error) + __pyx_t_8 = __Pyx_PyBytes_FromStringAndSize(((char const *)__pyx_v_digest) + 0, __pyx_v_digest_size - 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 318, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_5 = 1; { @@ -6512,7 +6362,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf __pyx_t_4 = __Pyx_PyObject_FastCall((PyObject*)(&PyBytes_Type), __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_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L4_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); } __pyx_t_2 = __pyx_t_4; @@ -6523,18 +6373,18 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_hex, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L4_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L4_error) + __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L4_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 334, __pyx_L4_error) + __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 318, __pyx_L4_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_self->BlockC->hash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9); } - /* "polluck_blockchain/placeholder_native.pyx":336 + /* "polluck_blockchain/placeholder_native.pyx":320 * self.BlockC.hash = bytes(digest[:digest_size]).hex().encode("UTF-8") * finally: * free(digest) # <<<<<<<<<<<<<< @@ -6583,7 +6433,7 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf __pyx_L5:; } - /* "polluck_blockchain/placeholder_native.pyx":338 + /* "polluck_blockchain/placeholder_native.pyx":322 * free(digest) * * return self.hash # <<<<<<<<<<<<<< @@ -6591,13 +6441,13 @@ static PyObject *__pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perf * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_hash); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":325 + /* "polluck_blockchain/placeholder_native.pyx":309 * return digest * * cpdef perform_hash(self): # <<<<<<<<<<<<<< @@ -6671,7 +6521,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_7PyBlock_14p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("perform_hash", 0); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perform_hash(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = __pyx_f_18polluck_blockchain_18placeholder_native_7PyBlock_perform_hash(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -6892,7 +6742,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_7PyBlock_18_ return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":361 +/* "polluck_blockchain/placeholder_native.pyx":345 * cdef bint _genesis_done * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -6938,7 +6788,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__cinit__", 0); - /* "polluck_blockchain/placeholder_native.pyx":362 + /* "polluck_blockchain/placeholder_native.pyx":346 * * def __cinit__(self): * self._difficulty = 1 # <<<<<<<<<<<<<< @@ -6947,7 +6797,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin */ __pyx_v_self->_difficulty = 1; - /* "polluck_blockchain/placeholder_native.pyx":363 + /* "polluck_blockchain/placeholder_native.pyx":347 * def __cinit__(self): * self._difficulty = 1 * self._index = 0 # <<<<<<<<<<<<<< @@ -6956,7 +6806,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin */ __pyx_v_self->_index = ((uint64_t)0); - /* "polluck_blockchain/placeholder_native.pyx":364 + /* "polluck_blockchain/placeholder_native.pyx":348 * self._difficulty = 1 * self._index = 0 * self._genesis_done = 0 # <<<<<<<<<<<<<< @@ -6965,7 +6815,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin */ __pyx_v_self->_genesis_done = 0; - /* "polluck_blockchain/placeholder_native.pyx":365 + /* "polluck_blockchain/placeholder_native.pyx":349 * self._index = 0 * self._genesis_done = 0 * self._chain = new unordered_map[uint64_t, Block*]() # <<<<<<<<<<<<<< @@ -6976,11 +6826,11 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin __pyx_t_1 = new std::unordered_map (); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 365, __pyx_L1_error) + __PYX_ERR(0, 349, __pyx_L1_error) } __pyx_v_self->_chain = __pyx_t_1; - /* "polluck_blockchain/placeholder_native.pyx":366 + /* "polluck_blockchain/placeholder_native.pyx":350 * self._genesis_done = 0 * self._chain = new unordered_map[uint64_t, Block*]() * if self._chain is NULL: # <<<<<<<<<<<<<< @@ -6990,7 +6840,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin __pyx_t_2 = (__pyx_v_self->_chain == NULL); if (unlikely(__pyx_t_2)) { - /* "polluck_blockchain/placeholder_native.pyx":367 + /* "polluck_blockchain/placeholder_native.pyx":351 * self._chain = new unordered_map[uint64_t, Block*]() * if self._chain is NULL: * raise MemoryError("Could not allocate hasmap") # <<<<<<<<<<<<<< @@ -7003,14 +6853,14 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Could_not_allocate_hasmap}; __pyx_t_3 = __Pyx_PyObject_FastCall((PyObject*)(((PyTypeObject*)PyExc_MemoryError)), __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, 367, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __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, 367, __pyx_L1_error) + __PYX_ERR(0, 351, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":366 + /* "polluck_blockchain/placeholder_native.pyx":350 * self._genesis_done = 0 * self._chain = new unordered_map[uint64_t, Block*]() * if self._chain is NULL: # <<<<<<<<<<<<<< @@ -7019,7 +6869,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin */ } - /* "polluck_blockchain/placeholder_native.pyx":361 + /* "polluck_blockchain/placeholder_native.pyx":345 * cdef bint _genesis_done * * def __cinit__(self): # <<<<<<<<<<<<<< @@ -7040,7 +6890,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain___cin return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":369 +/* "polluck_blockchain/placeholder_native.pyx":353 * raise MemoryError("Could not allocate hasmap") * * def __init__(self, *args, **kwargs): # <<<<<<<<<<<<<< @@ -7088,7 +6938,7 @@ static int __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_2__in return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":372 +/* "polluck_blockchain/placeholder_native.pyx":356 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7113,7 +6963,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d std::unordered_map ::iterator __pyx_v_it; int __pyx_t_1; - /* "polluck_blockchain/placeholder_native.pyx":374 + /* "polluck_blockchain/placeholder_native.pyx":358 * def __dealloc__(self): * # ownership is typically not transferred from the Blockchain extension class * cdef BcHashmap.iterator it = self._chain.begin() # <<<<<<<<<<<<<< @@ -7122,7 +6972,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d */ __pyx_v_it = __pyx_v_self->_chain->begin(); - /* "polluck_blockchain/placeholder_native.pyx":375 + /* "polluck_blockchain/placeholder_native.pyx":359 * # ownership is typically not transferred from the Blockchain extension class * cdef BcHashmap.iterator it = self._chain.begin() * if self._chain is not NULL: # <<<<<<<<<<<<<< @@ -7132,7 +6982,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d __pyx_t_1 = (__pyx_v_self->_chain != NULL); if (__pyx_t_1) { - /* "polluck_blockchain/placeholder_native.pyx":376 + /* "polluck_blockchain/placeholder_native.pyx":360 * cdef BcHashmap.iterator it = self._chain.begin() * if self._chain is not NULL: * while it != self._chain.end(): # <<<<<<<<<<<<<< @@ -7143,7 +6993,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d __pyx_t_1 = (__pyx_v_it != __pyx_v_self->_chain->end()); if (!__pyx_t_1) break; - /* "polluck_blockchain/placeholder_native.pyx":377 + /* "polluck_blockchain/placeholder_native.pyx":361 * if self._chain is not NULL: * while it != self._chain.end(): * del dereference(it).second # <<<<<<<<<<<<<< @@ -7152,7 +7002,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d */ delete (*__pyx_v_it).second; - /* "polluck_blockchain/placeholder_native.pyx":378 + /* "polluck_blockchain/placeholder_native.pyx":362 * while it != self._chain.end(): * del dereference(it).second * postincrement(it) # <<<<<<<<<<<<<< @@ -7162,7 +7012,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d (void)((__pyx_v_it++)); } - /* "polluck_blockchain/placeholder_native.pyx":380 + /* "polluck_blockchain/placeholder_native.pyx":364 * postincrement(it) * * del self._chain # <<<<<<<<<<<<<< @@ -7171,7 +7021,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d */ delete __pyx_v_self->_chain; - /* "polluck_blockchain/placeholder_native.pyx":381 + /* "polluck_blockchain/placeholder_native.pyx":365 * * del self._chain * self._chain = NULL # <<<<<<<<<<<<<< @@ -7180,7 +7030,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d */ __pyx_v_self->_chain = NULL; - /* "polluck_blockchain/placeholder_native.pyx":375 + /* "polluck_blockchain/placeholder_native.pyx":359 * # ownership is typically not transferred from the Blockchain extension class * cdef BcHashmap.iterator it = self._chain.begin() * if self._chain is not NULL: # <<<<<<<<<<<<<< @@ -7189,7 +7039,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d */ } - /* "polluck_blockchain/placeholder_native.pyx":372 + /* "polluck_blockchain/placeholder_native.pyx":356 * pass * * def __dealloc__(self): # <<<<<<<<<<<<<< @@ -7200,7 +7050,7 @@ static void __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_4__d /* function exit code */ } -/* "polluck_blockchain/placeholder_native.pyx":383 +/* "polluck_blockchain/placeholder_native.pyx":367 * self._chain = NULL * * def __len__(self): # <<<<<<<<<<<<<< @@ -7226,7 +7076,7 @@ static Py_ssize_t __pyx_pw_18polluck_blockchain_18placeholder_native_10Blockchai static Py_ssize_t __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain_6__len__(struct __pyx_obj_18polluck_blockchain_18placeholder_native_Blockchain *__pyx_v_self) { Py_ssize_t __pyx_r; - /* "polluck_blockchain/placeholder_native.pyx":384 + /* "polluck_blockchain/placeholder_native.pyx":368 * * def __len__(self): * return self._index + 1 # <<<<<<<<<<<<<< @@ -7236,7 +7086,7 @@ static Py_ssize_t __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchai __pyx_r = (__pyx_v_self->_index + 1); goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":383 + /* "polluck_blockchain/placeholder_native.pyx":367 * self._chain = NULL * * def __len__(self): # <<<<<<<<<<<<<< @@ -7249,7 +7099,7 @@ static Py_ssize_t __pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchai return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":386 +/* "polluck_blockchain/placeholder_native.pyx":370 * return self._index + 1 * * def print_key_value_pair(self): # <<<<<<<<<<<<<< @@ -7316,7 +7166,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("print_key_value_pair", 0); - /* "polluck_blockchain/placeholder_native.pyx":387 + /* "polluck_blockchain/placeholder_native.pyx":371 * * def print_key_value_pair(self): * cdef BcHashmap.iterator it = self._chain.begin() # <<<<<<<<<<<<<< @@ -7325,7 +7175,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain */ __pyx_v_it = __pyx_v_self->_chain->begin(); - /* "polluck_blockchain/placeholder_native.pyx":389 + /* "polluck_blockchain/placeholder_native.pyx":373 * cdef BcHashmap.iterator it = self._chain.begin() * cdef Block *block * while it != self._chain.end(): # <<<<<<<<<<<<<< @@ -7336,7 +7186,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_1 = (__pyx_v_it != __pyx_v_self->_chain->end()); if (!__pyx_t_1) break; - /* "polluck_blockchain/placeholder_native.pyx":390 + /* "polluck_blockchain/placeholder_native.pyx":374 * cdef Block *block * while it != self._chain.end(): * print(dereference(it).first) # <<<<<<<<<<<<<< @@ -7344,7 +7194,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_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, 390, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyLong_From_uint64_t((*__pyx_v_it).first); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = 1; { @@ -7352,12 +7202,12 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_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, 390, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":391 + /* "polluck_blockchain/placeholder_native.pyx":375 * while it != self._chain.end(): * print(dereference(it).first) * block = dereference(it).second # <<<<<<<<<<<<<< @@ -7367,19 +7217,19 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_6 = (*__pyx_v_it).second; __pyx_v_block = __pyx_t_6; - /* "polluck_blockchain/placeholder_native.pyx":392 + /* "polluck_blockchain/placeholder_native.pyx":376 * 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_18polluck_blockchain_18placeholder_native_PyBlock->from_ptr(__pyx_v_block, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_2 = ((PyObject *)__pyx_vtabptr_18polluck_blockchain_18placeholder_native_PyBlock->from_ptr(__pyx_v_block, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_XDECREF_SET(__pyx_v_py_block, ((struct __pyx_obj_18polluck_blockchain_18placeholder_native_PyBlock *)__pyx_t_2)); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":393 + /* "polluck_blockchain/placeholder_native.pyx":377 * block = dereference(it).second * py_block = PyBlock.from_ptr(block) * print(py_block) # <<<<<<<<<<<<<< @@ -7392,12 +7242,12 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_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, 393, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":394 + /* "polluck_blockchain/placeholder_native.pyx":378 * py_block = PyBlock.from_ptr(block) * print(py_block) * postincrement(it) # <<<<<<<<<<<<<< @@ -7407,7 +7257,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain (void)((__pyx_v_it++)); } - /* "polluck_blockchain/placeholder_native.pyx":386 + /* "polluck_blockchain/placeholder_native.pyx":370 * return self._index + 1 * * def print_key_value_pair(self): # <<<<<<<<<<<<<< @@ -7431,7 +7281,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":396 +/* "polluck_blockchain/placeholder_native.pyx":380 * postincrement(it) * * @property # <<<<<<<<<<<<<< @@ -7463,7 +7313,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "polluck_blockchain/placeholder_native.pyx":398 + /* "polluck_blockchain/placeholder_native.pyx":382 * @property * def genesis_done(self): * return self._genesis_done # <<<<<<<<<<<<<< @@ -7471,13 +7321,13 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_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, 398, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->_genesis_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":396 + /* "polluck_blockchain/placeholder_native.pyx":380 * postincrement(it) * * @property # <<<<<<<<<<<<<< @@ -7496,7 +7346,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":400 +/* "polluck_blockchain/placeholder_native.pyx":384 * return self._genesis_done * * @property # <<<<<<<<<<<<<< @@ -7528,7 +7378,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__get__", 0); - /* "polluck_blockchain/placeholder_native.pyx":402 + /* "polluck_blockchain/placeholder_native.pyx":386 * @property * def index(self): * return self._index # <<<<<<<<<<<<<< @@ -7536,13 +7386,13 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain * # TODO error handling */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":400 + /* "polluck_blockchain/placeholder_native.pyx":384 * return self._genesis_done * * @property # <<<<<<<<<<<<<< @@ -7561,7 +7411,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":405 +/* "polluck_blockchain/placeholder_native.pyx":389 * * # TODO error handling * cdef Block* get_block_c(self, uint64_t idx): # <<<<<<<<<<<<<< @@ -7572,7 +7422,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain static ::Block *__pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_get_block_c(struct __pyx_obj_18polluck_blockchain_18placeholder_native_Blockchain *__pyx_v_self, uint64_t __pyx_v_idx) { ::Block *__pyx_r; - /* "polluck_blockchain/placeholder_native.pyx":406 + /* "polluck_blockchain/placeholder_native.pyx":390 * # TODO error handling * cdef Block* get_block_c(self, uint64_t idx): * return self._chain[0][idx] # <<<<<<<<<<<<<< @@ -7582,7 +7432,7 @@ static ::Block *__pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_g __pyx_r = ((__pyx_v_self->_chain[0])[__pyx_v_idx]); goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":405 + /* "polluck_blockchain/placeholder_native.pyx":389 * * # TODO error handling * cdef Block* get_block_c(self, uint64_t idx): # <<<<<<<<<<<<<< @@ -7595,7 +7445,7 @@ static ::Block *__pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_g return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":408 +/* "polluck_blockchain/placeholder_native.pyx":392 * return self._chain[0][idx] * * def get_block(self, idx): # <<<<<<<<<<<<<< @@ -7642,32 +7492,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, 408, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 392, __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, 408, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 392, __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, 408, __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, 392, __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, 408, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_block", 1, 1, 1, i); __PYX_ERR(0, 392, __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, 408, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 392, __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, 408, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("get_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 392, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -7705,32 +7555,32 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("get_block", 0); - /* "polluck_blockchain/placeholder_native.pyx":409 + /* "polluck_blockchain/placeholder_native.pyx":393 * * 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, 409, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 409, __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, 393, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 393, __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, 409, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyLong_From_uint64_t(__pyx_v_self->_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 393, __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, 409, __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, 393, __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, 409, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 393, __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)) { - /* "polluck_blockchain/placeholder_native.pyx":410 + /* "polluck_blockchain/placeholder_native.pyx":394 * def get_block(self, idx): * if idx < 0 or idx > self._index: * raise IndexError("Index value is out of bounds") # <<<<<<<<<<<<<< @@ -7743,14 +7593,14 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_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, 410, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __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, 410, __pyx_L1_error) + __PYX_ERR(0, 394, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":409 + /* "polluck_blockchain/placeholder_native.pyx":393 * * def get_block(self, idx): * if idx < 0 or idx > self._index: # <<<<<<<<<<<<<< @@ -7759,18 +7609,18 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain */ } - /* "polluck_blockchain/placeholder_native.pyx":412 + /* "polluck_blockchain/placeholder_native.pyx":396 * raise IndexError("Index value is out of bounds") * * cdef Block *block = self.get_block_c(idx) # <<<<<<<<<<<<<< * return PyBlock.from_ptr(block, owner=False) * */ - __pyx_t_6 = __Pyx_PyLong_As_uint64_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 412, __pyx_L1_error) - __pyx_t_7 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 412, __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, 396, __pyx_L1_error) + __pyx_t_7 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error) __pyx_v_block = __pyx_t_7; - /* "polluck_blockchain/placeholder_native.pyx":413 + /* "polluck_blockchain/placeholder_native.pyx":397 * * cdef Block *block = self.get_block_c(idx) * return PyBlock.from_ptr(block, owner=False) # <<<<<<<<<<<<<< @@ -7780,13 +7630,13 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __Pyx_XDECREF(__pyx_r); __pyx_t_8.__pyx_n = 1; __pyx_t_8.owner = 0; - __pyx_t_4 = ((PyObject *)__pyx_vtabptr_18polluck_blockchain_18placeholder_native_PyBlock->from_ptr(__pyx_v_block, &__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_4 = ((PyObject *)__pyx_vtabptr_18polluck_blockchain_18placeholder_native_PyBlock->from_ptr(__pyx_v_block, &__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "polluck_blockchain/placeholder_native.pyx":408 + /* "polluck_blockchain/placeholder_native.pyx":392 * return self._chain[0][idx] * * def get_block(self, idx): # <<<<<<<<<<<<<< @@ -7806,7 +7656,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":415 +/* "polluck_blockchain/placeholder_native.pyx":399 * return PyBlock.from_ptr(block, owner=False) * * cdef void add_block(self, Block *block): # <<<<<<<<<<<<<< @@ -7816,7 +7666,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain static void __pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_block(struct __pyx_obj_18polluck_blockchain_18placeholder_native_Blockchain *__pyx_v_self, ::Block *__pyx_v_block) { - /* "polluck_blockchain/placeholder_native.pyx":416 + /* "polluck_blockchain/placeholder_native.pyx":400 * * cdef void add_block(self, Block *block): * self._chain[0][block.index] = block # <<<<<<<<<<<<<< @@ -7825,7 +7675,7 @@ static void __pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_b */ ((__pyx_v_self->_chain[0])[__pyx_v_block->index]) = __pyx_v_block; - /* "polluck_blockchain/placeholder_native.pyx":417 + /* "polluck_blockchain/placeholder_native.pyx":401 * cdef void add_block(self, Block *block): * self._chain[0][block.index] = block * if self._genesis_done: # <<<<<<<<<<<<<< @@ -7834,7 +7684,7 @@ static void __pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_b */ if (__pyx_v_self->_genesis_done) { - /* "polluck_blockchain/placeholder_native.pyx":418 + /* "polluck_blockchain/placeholder_native.pyx":402 * self._chain[0][block.index] = block * if self._genesis_done: * self._index += 1 # <<<<<<<<<<<<<< @@ -7843,7 +7693,7 @@ static void __pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_b */ __pyx_v_self->_index = (__pyx_v_self->_index + 1); - /* "polluck_blockchain/placeholder_native.pyx":417 + /* "polluck_blockchain/placeholder_native.pyx":401 * cdef void add_block(self, Block *block): * self._chain[0][block.index] = block * if self._genesis_done: # <<<<<<<<<<<<<< @@ -7852,7 +7702,7 @@ static void __pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_b */ } - /* "polluck_blockchain/placeholder_native.pyx":415 + /* "polluck_blockchain/placeholder_native.pyx":399 * return PyBlock.from_ptr(block, owner=False) * * cdef void add_block(self, Block *block): # <<<<<<<<<<<<<< @@ -7863,7 +7713,7 @@ static void __pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_b /* function exit code */ } -/* "polluck_blockchain/placeholder_native.pyx":420 +/* "polluck_blockchain/placeholder_native.pyx":404 * self._index += 1 * * def create_genesis_block(self): # <<<<<<<<<<<<<< @@ -7932,19 +7782,19 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("create_genesis_block", 0); - /* "polluck_blockchain/placeholder_native.pyx":423 + /* "polluck_blockchain/placeholder_native.pyx":407 * cdef Block *block = new Block( * self._index, * int(datetime.datetime(2025, 12, 1, 12, 0, 0).timestamp()), # <<<<<<<<<<<<<< * 0, * "Genesis Block".encode("UTF-8"), */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __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, 423, __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, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_2 = __pyx_t_3; @@ -7955,43 +7805,43 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __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_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); } - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 423, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "polluck_blockchain/placeholder_native.pyx":425 + /* "polluck_blockchain/placeholder_native.pyx":409 * int(datetime.datetime(2025, 12, 1, 12, 0, 0).timestamp()), * 0, * "Genesis Block".encode("UTF-8"), # <<<<<<<<<<<<<< * "0".encode("UTF-8"), * "".encode("UTF-8"), */ - __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_Genesis_Block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_7 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_Genesis_Block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 409, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":426 + /* "polluck_blockchain/placeholder_native.pyx":410 * 0, * "Genesis Block".encode("UTF-8"), * "0".encode("UTF-8"), # <<<<<<<<<<<<<< * "".encode("UTF-8"), * ) */ - __pyx_t_8 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_8 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":427 + /* "polluck_blockchain/placeholder_native.pyx":411 * "Genesis Block".encode("UTF-8"), * "0".encode("UTF-8"), * "".encode("UTF-8"), # <<<<<<<<<<<<<< * ) * block.hash = "dummy hash".encode("UTF-8") */ - __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 411, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":421 + /* "polluck_blockchain/placeholder_native.pyx":405 * * def create_genesis_block(self): * cdef Block *block = new Block( # <<<<<<<<<<<<<< @@ -8002,30 +7852,30 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_10 = new ::Block(__pyx_v_self->_index, __pyx_t_6, 0, __pyx_t_7, __pyx_t_8, __pyx_t_9); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 421, __pyx_L1_error) + __PYX_ERR(0, 405, __pyx_L1_error) } __pyx_v_block = __pyx_t_10; - /* "polluck_blockchain/placeholder_native.pyx":429 + /* "polluck_blockchain/placeholder_native.pyx":413 * "".encode("UTF-8"), * ) * block.hash = "dummy hash".encode("UTF-8") # <<<<<<<<<<<<<< * self.add_block(block) * self._genesis_done = True */ - __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_dummy_hash); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_dummy_hash); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L1_error) __pyx_v_block->hash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9); - /* "polluck_blockchain/placeholder_native.pyx":430 + /* "polluck_blockchain/placeholder_native.pyx":414 * ) * block.hash = "dummy hash".encode("UTF-8") * self.add_block(block) # <<<<<<<<<<<<<< * self._genesis_done = True * */ - ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 430, __pyx_L1_error) + ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 414, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":431 + /* "polluck_blockchain/placeholder_native.pyx":415 * block.hash = "dummy hash".encode("UTF-8") * self.add_block(block) * self._genesis_done = True # <<<<<<<<<<<<<< @@ -8034,7 +7884,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain */ __pyx_v_self->_genesis_done = 1; - /* "polluck_blockchain/placeholder_native.pyx":420 + /* "polluck_blockchain/placeholder_native.pyx":404 * self._index += 1 * * def create_genesis_block(self): # <<<<<<<<<<<<<< @@ -8058,7 +7908,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain return __pyx_r; } -/* "polluck_blockchain/placeholder_native.pyx":433 +/* "polluck_blockchain/placeholder_native.pyx":417 * self._genesis_done = True * * def new_block(self, data): # <<<<<<<<<<<<<< @@ -8105,32 +7955,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, 433, __pyx_L3_error) + if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 417, __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, 433, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __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, 433, __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, 417, __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, 433, __pyx_L3_error) } + if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("new_block", 1, 1, 1, i); __PYX_ERR(0, 417, __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, 433, __pyx_L3_error) + if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 417, __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, 433, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("new_block", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -8173,7 +8023,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain int __pyx_clineno = 0; __Pyx_RefNannySetupContext("new_block", 0); - /* "polluck_blockchain/placeholder_native.pyx":434 + /* "polluck_blockchain/placeholder_native.pyx":418 * * def new_block(self, data): * if not self._genesis_done: # <<<<<<<<<<<<<< @@ -8183,7 +8033,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_1 = (!__pyx_v_self->_genesis_done); if (unlikely(__pyx_t_1)) { - /* "polluck_blockchain/placeholder_native.pyx":435 + /* "polluck_blockchain/placeholder_native.pyx":419 * def new_block(self, data): * if not self._genesis_done: * raise RuntimeError("Create a genesis block first.") # <<<<<<<<<<<<<< @@ -8196,14 +8046,14 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_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, 435, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __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, 435, __pyx_L1_error) + __PYX_ERR(0, 419, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":434 + /* "polluck_blockchain/placeholder_native.pyx":418 * * def new_block(self, data): * if not self._genesis_done: # <<<<<<<<<<<<<< @@ -8212,17 +8062,17 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain */ } - /* "polluck_blockchain/placeholder_native.pyx":437 + /* "polluck_blockchain/placeholder_native.pyx":421 * raise RuntimeError("Create a genesis block first.") * * cdef Block *prev_block = self.get_block_c(self._index) # <<<<<<<<<<<<<< * cdef string prev_hash = prev_block.prev_hash * cdef uint64_t new_idx = self._index + 1 */ - __pyx_t_5 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_v_self->_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_5 = ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->get_block_c(__pyx_v_self, __pyx_v_self->_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 421, __pyx_L1_error) __pyx_v_prev_block = __pyx_t_5; - /* "polluck_blockchain/placeholder_native.pyx":438 + /* "polluck_blockchain/placeholder_native.pyx":422 * * cdef Block *prev_block = self.get_block_c(self._index) * cdef string prev_hash = prev_block.prev_hash # <<<<<<<<<<<<<< @@ -8232,7 +8082,7 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_6 = __pyx_v_prev_block->prev_hash; __pyx_v_prev_hash = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6); - /* "polluck_blockchain/placeholder_native.pyx":439 + /* "polluck_blockchain/placeholder_native.pyx":423 * cdef Block *prev_block = self.get_block_c(self._index) * cdef string prev_hash = prev_block.prev_hash * cdef uint64_t new_idx = self._index + 1 # <<<<<<<<<<<<<< @@ -8241,19 +8091,19 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain */ __pyx_v_new_idx = (__pyx_v_self->_index + 1); - /* "polluck_blockchain/placeholder_native.pyx":443 + /* "polluck_blockchain/placeholder_native.pyx":427 * cdef Block *block = new Block( * new_idx, * int(datetime.datetime(2025, 12, 1, 12, 0, 0).timestamp()), # <<<<<<<<<<<<<< * 0, * data.encode("UTF-8"), */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_datetime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[0], NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = __pyx_t_7; @@ -8264,16 +8114,16 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_timestamp, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); } - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "polluck_blockchain/placeholder_native.pyx":445 + /* "polluck_blockchain/placeholder_native.pyx":429 * int(datetime.datetime(2025, 12, 1, 12, 0, 0).timestamp()), * 0, * data.encode("UTF-8"), # <<<<<<<<<<<<<< @@ -8287,22 +8137,22 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_UTF_8}; __pyx_t_7 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET)); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 445, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); } - __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "polluck_blockchain/placeholder_native.pyx":447 + /* "polluck_blockchain/placeholder_native.pyx":431 * data.encode("UTF-8"), * prev_hash, * "".encode("UTF-8"), # <<<<<<<<<<<<<< * ) * self.add_block(block) */ - __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_10 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_mstate_global->__pyx_kp_b_); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":441 + /* "polluck_blockchain/placeholder_native.pyx":425 * cdef uint64_t new_idx = self._index + 1 * * cdef Block *block = new Block( # <<<<<<<<<<<<<< @@ -8313,20 +8163,20 @@ static PyObject *__pyx_pf_18polluck_blockchain_18placeholder_native_10Blockchain __pyx_t_5 = new ::Block(__pyx_v_new_idx, __pyx_t_9, 0, __pyx_t_6, __pyx_v_prev_hash, __pyx_t_10); } catch(...) { __Pyx_CppExn2PyErr(); - __PYX_ERR(0, 441, __pyx_L1_error) + __PYX_ERR(0, 425, __pyx_L1_error) } __pyx_v_block = __pyx_t_5; - /* "polluck_blockchain/placeholder_native.pyx":449 + /* "polluck_blockchain/placeholder_native.pyx":433 * "".encode("UTF-8"), * ) * self.add_block(block) # <<<<<<<<<<<<<< * * # def __init__( */ - ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error) + ((struct __pyx_vtabstruct_18polluck_blockchain_18placeholder_native_Blockchain *)__pyx_v_self->__pyx_vtab)->add_block(__pyx_v_self, __pyx_v_block); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error) - /* "polluck_blockchain/placeholder_native.pyx":433 + /* "polluck_blockchain/placeholder_native.pyx":417 * self._genesis_done = True * * def new_block(self, data): # <<<<<<<<<<<<<< @@ -9000,15 +8850,15 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_vtable_18polluck_blockchain_18placeholder_native_Blockchain.get_block_c = (::Block *(*)(struct __pyx_obj_18polluck_blockchain_18placeholder_native_Blockchain *, uint64_t))__pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_get_block_c; __pyx_vtable_18polluck_blockchain_18placeholder_native_Blockchain.add_block = (void (*)(struct __pyx_obj_18polluck_blockchain_18placeholder_native_Blockchain *, ::Block *))__pyx_f_18polluck_blockchain_18placeholder_native_10Blockchain_add_block; #if CYTHON_USE_TYPE_SPECS - __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_18polluck_blockchain_18placeholder_native_Blockchain_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain)) __PYX_ERR(0, 355, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_18polluck_blockchain_18placeholder_native_Blockchain_spec, __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_18polluck_blockchain_18placeholder_native_Blockchain_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain)) __PYX_ERR(0, 339, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_18polluck_blockchain_18placeholder_native_Blockchain_spec, __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 339, __pyx_L1_error) #else __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain = &__pyx_type_18polluck_blockchain_18placeholder_native_Blockchain; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 355, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 339, __pyx_L1_error) #endif #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000 PyUnstable_Object_EnableDeferredRefcount((PyObject*)__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain); @@ -9018,10 +8868,10 @@ static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) { __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain->tp_getattro = PyObject_GenericGetAttr; } #endif - if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_vtabptr_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 355, __pyx_L1_error) - if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 355, __pyx_L1_error) - if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Blockchain, (PyObject *) __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 355, __pyx_L1_error) - if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 355, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_vtabptr_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 339, __pyx_L1_error) + if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 339, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Blockchain, (PyObject *) __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 339, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain) < (0)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -9418,19 +9268,19 @@ __Pyx_RefNannySetupContext("PyInit_placeholder_native", 0); if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_18polluck_blockchain_18placeholder_native_PyBlock, __pyx_mstate_global->__pyx_n_u_mine, __pyx_t_2) < (0)) __PYX_ERR(0, 264, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":325 + /* "polluck_blockchain/placeholder_native.pyx":309 * return digest * * cpdef perform_hash(self): # <<<<<<<<<<<<<< * cdef: * unsigned char *digest */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_7PyBlock_15perform_hash, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_perform_hash, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_7PyBlock_15perform_hash, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_PyBlock_perform_hash, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __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_18polluck_blockchain_18placeholder_native_PyBlock, __pyx_mstate_global->__pyx_n_u_perform_hash, __pyx_t_2) < (0)) __PYX_ERR(0, 325, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_18polluck_blockchain_18placeholder_native_PyBlock, __pyx_mstate_global->__pyx_n_u_perform_hash, __pyx_t_2) < (0)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 @@ -9460,64 +9310,64 @@ __Pyx_RefNannySetupContext("PyInit_placeholder_native", 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; - /* "polluck_blockchain/placeholder_native.pyx":386 + /* "polluck_blockchain/placeholder_native.pyx":370 * return self._index + 1 * * def print_key_value_pair(self): # <<<<<<<<<<<<<< * cdef BcHashmap.iterator it = self._chain.begin() * cdef Block *block */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_9print_key_value_pair, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_print_key_value_pair, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_9print_key_value_pair, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_print_key_value_pair, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __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_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_print_key_value_pair, __pyx_t_2) < (0)) __PYX_ERR(0, 386, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_print_key_value_pair, __pyx_t_2) < (0)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":408 + /* "polluck_blockchain/placeholder_native.pyx":392 * return self._chain[0][idx] * * 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_18polluck_blockchain_18placeholder_native_10Blockchain_11get_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_get_block, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_11get_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_get_block, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __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_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_get_block, __pyx_t_2) < (0)) __PYX_ERR(0, 408, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_get_block, __pyx_t_2) < (0)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":420 + /* "polluck_blockchain/placeholder_native.pyx":404 * self._index += 1 * * def create_genesis_block(self): # <<<<<<<<<<<<<< * cdef Block *block = new Block( * self._index, */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_13create_genesis_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_create_genesis_block, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_13create_genesis_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_create_genesis_block, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __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_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_create_genesis_block, __pyx_t_2) < (0)) __PYX_ERR(0, 420, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_create_genesis_block, __pyx_t_2) < (0)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "polluck_blockchain/placeholder_native.pyx":433 + /* "polluck_blockchain/placeholder_native.pyx":417 * self._genesis_done = True * * def new_block(self, data): # <<<<<<<<<<<<<< * if not self._genesis_done: * raise RuntimeError("Create a genesis block first.") */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_15new_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_new_block, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_18polluck_blockchain_18placeholder_native_10Blockchain_15new_block, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Blockchain_new_block, NULL, __pyx_mstate_global->__pyx_n_u_polluck_blockchain_placeholder_n, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __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_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_new_block, __pyx_t_2) < (0)) __PYX_ERR(0, 433, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_18polluck_blockchain_18placeholder_native_Blockchain, __pyx_mstate_global->__pyx_n_u_new_block, __pyx_t_2) < (0)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "(tree fragment)":1 @@ -9593,7 +9443,7 @@ __Pyx_RefNannySetupContext("PyInit_placeholder_native", 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, 390, __pyx_L1_error) + __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_print); if (!__pyx_builtin_print) __PYX_ERR(0, 374, __pyx_L1_error) /* Cached unbound methods */ __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type; @@ -9657,25 +9507,25 @@ 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[] = {{25},{29},{28},{20},{8},{5},{1},{1},{7},{6},{2},{9},{50},{45},{14},{10},{28},{30},{31},{20},{20},{31},{7},{25},{27},{23},{12},{20},{20},{12},{18},{5},{15},{18},{20},{4},{8},{10},{11},{20},{6},{8},{13},{8},{9},{12},{4},{7},{3},{3},{5},{13},{2},{5},{8},{9},{4},{10},{8},{9},{7},{5},{12},{37},{3},{10},{9},{13},{5},{20},{8},{11},{14},{12},{10},{17},{13},{8},{4},{13},{14},{12},{10},{12},{19},{6},{8},{4},{9},{6},{0},{1},{13},{10},{52},{121},{37},{101},{71},{73},{170},{9}}; - #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (1149 bytes) */ -const char* const cstring = "BZh91AY&SYw\304\363Q\000\000\250\177\377\375\377\377\257\367\177\374\347\277\367\377^\277\357\377\362@@@@@@@@@@@@@\000@\000P\003\376+l\032\002\203\033\rS\320\242mM\006\230z$\323\324\006\200\323M4\032\003CM\000\006\200\310\006A\265\036\246&&\010!\004\323F\223\010F\217\322\217)\220\000\000\006\200\000\000\000\000\032\000\000\032\034\000\000\000\000\000\001\220\000\000\000\000\000\000\000\031\000\016\000\000\000\000\000\000\310\000\000\000\000\000\000\000\014\200\002SH\020\010\236\251\260\nz\221\262C@\032\000h\000\r\003C \000\000\323\324=C\324\365=J\352\325w]\233\367o\344\343?\2168\302+\221\335r\362\274\016I\224\345\346\250\346\020\201!2R7\232d\263Y\314\332\216q*\331\213\0010\311%\202\tI\250\254O\210:&\207A6\020\327!\027L\311\221n\204e\001M\222J(\251\324\236u\311\257s7\"\r\214\340\255\233Sj\244\362;4\237\320o>\301\203f\202\252\241\0261\335;\016\211\330K\346\001\022\310\236s\247N}s7\347\354\327\315\341\273vv\361\350U\244f}\n\t#F\373\361J\030\333\277\274:h\3173\000\370\2434\353!\\\312`[\026\302\304\001\262\004B/U\004\003\262\372hu|\030\032\201\321\350\351\266k\235g\207\346p\020\tY\276\317 5\t(\020\005c\005^\2710,\203\272\0071\214l\2500c3\364\"\271\026+\272\360\316\276\354'\014(1r;\245D\315\217\010q\301\232\001\t?\017\007w\246;(\344\024\367\032\340_\001M\005\027*\351VF<\270B\266gB9\022\214e,\225\224ep\360\211T\030uA0\352)\255\264\205\365\306\212\277 \376\345\213\005\330\234\231P[\313\000\265\252)S5b\3758q\317A\234\201Q\270\257^\306\332x0\200\374\376\225\232\315\376\250f\203\032\223\017\273u\205{7\274D\372\306\265\240Q\202\307\377h\303LC\023A\204\247iV\002\222\034\006t\022\217\023Iq\270)\235d\031\007{\211.i\314\002\226T\340:\250I$#7\362\212\360B\364#\007\223\306\t$\221\032\02244\236t\210\311\373\235\315\t\225b\366>\361\305\255\245\205\326\034\005A\222\302\326&\370\026\023 A\340\232-&\253b\350\3653\033tb\332::\256\024_=\320\213\233Q\206\343.\206\010\231SP\341\221Y\230g\r7\205\3608\262C\270\267=lv\343\020\216\242r,\312\231]Qe\306D[u1\263\"-\272\244\335\r\025\0035\202/\332m""\324,\301~y\32111[>!\223$\311\204\222I\0254\010\206\004\355\301E\265\261\256\372\345\"\024\320\250\300\230I@\263\324\243U6\350\316\035J\2351\000\266\233\242i\324Gk\305\265\353\350C(3h\306\232MF\202\310\014\232\027\233J\210\364\340\265\310R\201r$\204\272N\262\300S,\222f0\212R\240\022\322\220`\206)\240H\354\256L\0078\312y\360\311\277\273N\263\014\020\231T\325\025 N\313\023P\213H^\355]6o\305\257\210\352V\301Y\203\215~\226\n\004\037\205\341\2356\004\023v\236{\267\260\267\266\311,\217\036qq\320\027\r\262\002\0161N\002\370\0164M\365\033\311\314\355\254\225\266y\212\2660\322k\357\217\373`\3224\247M\235\362\031\237dY\253\264\3362\231qh\3016Af\021s\217h\271\371\377\240,\211\2637H\304iM\0301}\374\035^\302\323\365\373\276\257`M\326\354\267X\355\t&\366\306\254\370.\020\303zy\212\022\340\332]\303\275\230\203\305J\365D\227\340\250\315bi\002{\"`\226\372PN_\250\376\373\225\362@SdUR\222\211j&\242Bd\235\245\252\326@=\353!\376|+EYj\014\006\360\350\233b\237\031{\313\014T!\026\034K\372\227\313\316\265\372\027\020\344,\274kR+\331XIN\251Y\235\340\037b\242\357\013\020\\\340\331\2169G\245\033\213\326XX\367\336Nqz\021\232\352}\n\272\200\230\333\346\231\200T\034\341\032\010u\036\212\030i\010#%I\323\212\243\312\212\223\262\2621\203F#\301U9IV;\377\342\356H\247\n\022\016\370\236j "; - PyObject *data = __Pyx_DecompressString(cstring, 1149, 2); + const struct { const unsigned int length: 8; } index[] = {{25},{29},{28},{20},{8},{5},{1},{1},{7},{6},{2},{9},{50},{45},{14},{10},{28},{30},{31},{20},{20},{31},{7},{25},{27},{23},{12},{20},{20},{12},{18},{5},{15},{18},{20},{4},{8},{10},{11},{20},{6},{8},{13},{8},{9},{12},{4},{7},{3},{3},{5},{13},{2},{5},{8},{9},{4},{10},{8},{9},{7},{5},{12},{37},{3},{10},{9},{13},{5},{20},{8},{11},{14},{12},{10},{17},{13},{8},{4},{13},{14},{12},{10},{12},{19},{6},{8},{4},{9},{6},{0},{1},{13},{10},{52},{121},{37},{101},{71},{73},{137},{9}}; + #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (1159 bytes) */ +const char* const cstring = "BZh91AY&SY\210\325\3277\000\000\241\177\377\375\377\377\357\367\177\374\347\277\367\367\326\277\357\377\360@@@@@@@@@@@@@\000@\000P\003\376-`\000\003c\203T\365OB\217D\323\000\364\215M\036\246\2004d\000\014\203 4\032\000\320\320\321\246M\2420'\224\021=P\241\264\322\031=\033R2hi\223\023\02020\214\215\r\006\232m\021\243\322\0314\320\0322\032\r\001\223f\210 #\021\223L\230LL\230&\023\023A\221\202\032\030\023\004\302\006\201\200\010\034\000\000\000\320\000\000\003@\r\000\000\320\000\003@\000\000\000\224\322&CS \230\232m&\2024CM\032\000\032\000\000\000\000\000\r\007\251\243'\246\245\225\323\337f\376\217\357\262\334\275\230\302+\266\34773\304\355\310\2377?=\202\020\201!2U\031\005\"\254\366\363\232\214\315U\203\026\211\231\257DZj4xf\007F\264:%!\0165\310E\3232d\310\373\361\252\251M\225\316\362\261\224%7\2448\2366\226Jj56 B\361+,Z\246F\251\370\265t\351\262\330$\300QDQf\023\327\201\331=;\365A*\2102gN\"\014\260IX\230\374J\177F@\314|\034&\0018@\341\020\001\034z\245\224\263u\033\020\010\354\"\221b\231n\024V'3\033$\3347\023c\000\340\202\350 \362(|\207[\305\007\315+f\n:t\207\277\306r\235*\2774\353\322\"\351[\367\376Y\366\377\035]\330\233\347m\3134bq\3623\302\035\357'`\360%5_\301\0137?\031D\244\306-G\"\222f\277\210?\3103@!S\361p\367y\343\2737 \245\201\246\005\320\024\220Mw\027\035\204c\334\276\0263:\021\377%\030\325V;\t\262\304<\"W\006\035LL:\212jP\205\326Fj\317\034\355U\231\203\026c\376\310\202\235\310\005\032\262u\263X.\307\016m3\031\310\025\233K5\340\333\355\325\342\200\373m\326g\353\206\2101\274\230}\273l:[3xI\360\032\215\002l\026\2774\330i\010bH/\252T+\275\253Q\033\241\227r<\026W\212\334\273\327\314\231\177\354\263\361\306\003W:b/\246\305\230\341\207=\037\031\261\346F\017S\306\t$\221\031\225\033\255S\312q\031?\373\300\320\221^g\265\362\234\272\332\253\361ZtJ\303\035\245\030\223\336ZH\201\007\202h\265M^\013\241\326\320i\312\332z\032\250(\276\212B.`\213\266\230\364\260D\306\232g%E\206q\2347n\013\240r\343\207N\232,c\204b\021\324J\242\334\211\226*\313q\030\321LS\315n4S\025i\266\361V""\014\326\210\273a\263xZ\002\3552\232bB\244\271FL\223&\022I$V\320\"\027\222\245\352-\255\215wYUD'\272\246\300\230I@\267\324\233W&\343\224:\325\272b\001I\355\211\253x\216\307\213t\360\303\2069A\233V\345{\306\263Ql\006M\013\315\362\262=\3440\302\352P\302\355\303F\237\321\362\2740Y\265U-/\"\273)(\03388\305\303\324\352@\214Cs\036C\036~\rZ\313\357Be[VV\201;,\306\360\212\020\271\332\311\341\236-tGUR\n\333\334k\2650L \374\217\r)\257 \233\371ym\313}8\261\325\215\343\270b8\005\311J\200\203\214O\242]\001\306\211\235F\342R8m\252\226\365\325\214_\250\327\3219\360\032\243Rt\332_\031\241\360\2135\2242\231\014\231\2320M\214Z\004bq\350-\375=\240-\211\206\216C0\325I\030\206&\231\262\330\016{i\363\233|\324X5b\272@\002\\\304\231\016f\204\036\252\217I\201\311\t\013\324\002\254\201f\200f\340\231\014\025\21284H\024\035\351\343\302\tP\234\256m/\266*\001j\252\253B\260\205h\372\347@\362\314{wL\r\014\342\026{YwO[\000'\032\277\023T{E\301\022!FZ\335\257c\225\321\000e\024\247\372-Ja\250\360\006\343\340\327\250\236\037Ee'K\256/\332k`M\037\336)\031\332\241\305\\=\005\334\303\227\205\"\n\356Bd%\017j \212\000c\022\232\t\300\200\177aJi\302<\233(\036\"\024\210\211\021\234!\202@@\006\004\000\024tL\037\370\273\222)\302\204\204F\256\271\270"; + PyObject *data = __Pyx_DecompressString(cstring, 1159, 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 (1041 bytes) */ -const char* const cstring = "x\332\205TMo\033E\030\216KD\234\260i\342~\020U\004XW\001\025J\\\322\"\001\022\0059\037\224T%\340\220\242\n\212F\343\331q<\312\356\316zg6\265\221\220r\364q\216s\234\343\036}\3141G\216>\356\321?!?\201w\326\03718\022\207\235yg\336\357\347}fwx\342{n\310\245\213}\237\023,\251\333\304\"\300\321NL\355\001\273\3074\244\202\t\267\016\352\023\267\301b!+\373\241G\333\356)\366\023\352\202\212'\322\345\r\267\316\223\320\023\007\334*\230\r\032\022\3526\354\345\317\235m\353\375\340\345\321\367\233_}\362\235\307\004\256\373\224\206v=&L\014%/\344\256G\0338\361\245\213PL\275\204P\204\\\017\222Hn\303m\312\230\2352\354\203\226\260\220I\204DL\036E\334\367\023r\202\362\002I\023\263\360Q\344cB\233\334\367h\214B,\331)\255D\235\3667\002\374\303c\301\223\230\320o\267'\346WRe\222\226td\223\207\010\375K'\250\024\022P\271NKr\274\320\010\255a1S\352c*g\356B\372f\346.\202\n%:\241\035\224\243\213\"\314\342\021z\243m\266\306+\305L\201cU\275#\251\000u\014\350\261?\351\370:`\341D\216h\334\340q\200`\374M\353\330\206o\227\021\211\016h[\036\322\306\321\376\217{\277\375t\260\207^\036\355`\321\t\t\343\025\302c\230=\004\021y\037\377\311B|\320 \026\"\031\3038\352\030z\274\006$\017K\014\037\225,\240\036k4\030\201\371w<\036\001`X0\"\246\304\312\330\220\206\204\003Ub\036\240H\306v\267\267\320{\020!\324HB\202\320\004\361\\\034\302\2227g?\237\325\233\264\315\2746\263LFP\313\244\025&\231\244\201@(\200y\330\265\215r&[\254\340\310\275\304\207\035\001\257\002\330'3\264\002\304\313M\247\241\234ege\226\235\021\217\242\230\236\016\215r)w\005\201\361D\214\016@\214\353\330\021u\306m\002\305\321\250O+\236J\373\250l\251\255\004\373\303r\257\236\325\014\213&\027\200G~\210bK(\2771\231'\334\211\253\203\260\213e\334\010\t\220F\217w\212\207\350\032N\302+L\200V\010\270bW\230\333dvyW\342\363g\243_NNL/\t\202\216\375)5\317\252Y\361\235\356\027\335X\335RO\224\247\357\353]S\310\234[\352S]\325\265Aq\035\316NZMkY\361]\305t\313,\247\265\261\217T[\326\3623\215ukP,\233;\346u\257\324\333\350\341\254\350\232\245\264l\267y\363C\272\235b\033h""\337\3242g9sV\272-U\324\213\246d>N\347\323\235T\366\236\364\352\347K\027\345\\\273\252\026TK\027r\371f\367X\325\0248;\335\347\n\253\326Y\365\2628\267\270\2249PU\337}\334+\367\266z\325\314\271\255\236\232\033\246<\000\337\202*\331\352F\311\340\374\177\351\336\323_\232\262\331\262fol\212\251\244\313\335W\352\265YK\013i)\033W\000B\337y_\347\020|d\216\322\265\336\333=0\275\331%\352\266\332\325\013Z\332X%U\002T\210)e\316\035\365\302\274e\357>\320\314\264\322\302P\t\271\357\351\222.CCKyCw\325\221\376\320f\002\324\362R\210.e\253\245!\034m\235\230\252\3715}\234\376q\276q^\277X\270h\375]\030u;(\256\3309\364\347\367.j\227\316\334\262\253\241\205\0076\317\375a_\033\340\ns\204\004\375{\017\323-;\312\001t\275\325_?\354\037\376b\223\375e'\r\311\006\000kU\377\236\336H+CxlQk\246`\326\373\233O\317k\347x\340\254\364Wl\274W@\207U@AS\310\260\352\202\311]\203\363\010yM\227\353s\213\016\360\2435\305\016\247\373L}\255\237\033|V\310\346\227\272\017U\355\037\254n\317b"; - PyObject *data = __Pyx_DecompressString(cstring, 1041, 1); + #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (1032 bytes) */ +const char* const cstring = "x\332\205TKo\0337\020\216Z\243\226\335\265\243\215\345\246F\372X\005I\2216\215R'\005\332\002}@~4\261\3218U\341\264E\341\202\240\270\224Ex\265\\\355r\035\251'\037u\344\221G\036\367\270G\037u\354Q\307=\352'\344't\270zX\255\014\364\260\344pf8\217o>\356.\217=\327\361\271p\260\347q\202\005uZ8j\343`7\244\346\200\235S\352\323\210EN\003\314gN\223\205\221\250\036\370.\355:\347\330\213\251\003&\036\013\2077\235\006\217}7:\342\306\300LP\237P\247i\224?\367v\314\355\007\257\216\177|\364\365\247?\270,\302\r\217R\337\254\247\204Ec\311\365\271\343\322&\216=\341 \024R7&\024!\307\205$\202\233p\217D\310\316\031\366\300J\230\317\004BQH\036\007\334\363br\206\362\002I\0133\377q\340aB[\334si\210|,\3309\255\006\275\356\267\021\334\367O#\036\207\204~\2773s\277\222\252\263\264\244'Z\334G\350_\266\210\212H\000*\327YI\216\027\232\2405.f\316|J\305\202\316\247\257\027t\001T(\320\031\355\241\034]\024`\026N\320\233l\2135^\031\026\n\234\232\032=A#0\207\200\036\373\213N\325m\346\317\344\200\206M\036\266\021\214\277e.v\341\333cD\240#\332\025\277\320\346\361\301\213\375?^\036\355\243W\307\2738\352\371\204\361*\341!\314\036\202Dy\037\377\311B<\260 \346#\021\3028\032\030z\274\006$\027\013\014\037\025\254M]\326l2\002\363\357\271<\000\300p\304H4'V\247\216\324'\034\250\022\3626\nDhv\243\205\336\333\001B\315\330'\010\315\020\317\3051,ys\346\363X\243E\273\314\3552\303d\004\265\314Za\202\t\332\216\020j\303<\314\332E9\223\rVp\344n\354\301\216\200Wm\330g34\002\304\313]\347\241\\dgu\221\235\001\017\202\220\236\217\235r)\277\n\002\343q49\0001\256cG\320\233\266\t\024G\223>\215x.\314\2432\245vb\354\215\313\275zV\013,\232)\000\217\374\020\204\206P^s6O\320EW\207\310,\206q\023$@\232<\3369\036\242k8\t\2570\006Z!\340\212Yan\263\331\345]E_<\233\374rrb\272q\273\3353?\245\326E-+\276\333\377\262\037\312[\362\251t\325]\265\247\013\231uK~\246j\252>*~\000g+\251%\365\254\370\236d\252\243\327\222\372\364\216\220\333\306\363s\205UgT\254\350\262>I\355\364^\212\263\242\243W\223\212\331\226\364\363d'\301&\320\201\256g\326Zf\335\354w""dQ\255h[\177\222,%\273\211H\237\246\215\313\325A%\267\226\344\262\354\250B.\257\367Oe]\302e\253\177(\261\354\\\324\336\024o\254\254f\026T5t\236\244\225t;\255e\326\206\374N\277\245+#\270[\220\266\251n\222\014\316\377\227\356\216\372JW\364\266q{mR\314%]\353\377.O\364\355\244\220\330\331\264\002\020\206\326\207*\207\340\276>Nn\247\357\244\340\272\336'rC\356\251e%L,[\332\200\n\321vf\225\345O\372m\243\373H1\335I\nc#\344\336R\266\252@C\253yC\233\362X}l2\001jy)D\331Y\311\036\303\321U\261\256\351_\223'\311\237\227\367.\033\203\345A\347\357\302\244\333Q\361\246\231\303pi\177P\177c\335Xs\024\264\360 )\214\212\020r\270\3650\3316\303\033\255\255\233P+j\323\314*+9\272\240\357\300\\\374\313\303\001\316J[\252\254~\203\024'\303\355\332\300\036TF\245\215\341\006\004I\336O\355\254|WW\262\362}\300\263\2749*\225eM\002-\314\370;s\303\267\372\317\3447\352P\343\213B\266\264\332\177(\353\377\000\243\266\303)"; + PyObject *data = __Pyx_DecompressString(cstring, 1032, 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 (1830 bytes) */ -const char* const bytes = "Could not allocate hasmapCreate a genesis block first.Index value is out of boundsNo valid nonce foundPyBlock(UTF-8)?disableenablegcisenabledno default __reduce__ due to non-trivial __cinit__src/polluck_blockchain/placeholder_native.pyxBlockchainBlockchain.__reduce_cython__Blockchain.__setstate_cython__Blockchain.create_genesis_blockBlockchain.get_blockBlockchain.new_blockBlockchain.print_key_value_pairPyBlockPyBlock.__reduce_cython__PyBlock.__setstate_cython__PyBlock.bytes_serializePyBlock.minePyBlock.perform_hash__Pyx_PyDict_NextRefTIMEZONE_UTCasyncio.coroutinesblockbytes_serializecline_in_tracebackcreate_genesis_blockdatadatetimedifficultydopt_basicsdopt_basics.datetimeencodefrom_ptrfromtimestamp__func__get_block__getstate__hashhashlibhexidxindex_is_coroutineititems__main__max_noncemine__module____name__new_blocknew_idxnonceperform_hashpolluck_blockchain.placeholder_nativepopprev_blockprev_hashprevious_hashprintprint_key_value_pairpy_block__pyx_state__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____repr__selfserialize_resserialize_size__set_name__setdefault__setstate____setstate_cython__struct__test__timetimestampvalues0Genesis Blockdummy hash\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\026\220i\230q\240\r\250Q\200A\330\010\013\2104\210t\2201\330\014\022\220,\230a\230q\340\010!\240\024\240\\\260\021\260$\260a\330\010 \240\n\250!\330\010 \240\004\240H\250B\250a\340\010\034\230I\240Q\330\014\r\330\014\017\210q\220\010\230\t\240\021\240&\250\004\250C\250t\2603\260b\270\n\300!\330\014\r\330\014\020\220\007\220q\230\001\330\014\r\330\014\016\210g\220Q\220a\340\010\014\210J\220a\220q\200A\360\010\000\t\n\330\014\034\230D\320 2\260!\2601\260A\330\014\023\220=\240\002\240!\340\014\020\220\001\220\021\200A\330\010\034\230I\240Q\330\014\020\220\001\330\014\017\210q\220\010\230\t\240\021\240&\250\004\250C\250t\2603\260b\270\n\300!\330\014\r\330\014\033""\2307\240!\2401\330\014\017\210w\220a\220q\330\014\016\210g\220Q\220a\340\010\r\210X\220\\\240\027\250\001\250\021\330\010\014\210J\220a\220q\330\010\014\320\014\035\230Q\200A\330\010%\240T\250\027\260\006\260a\340\010\016\210c\220\023\220D\230\007\230t\2401\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\n\000\t\n\330\014\025\220T\230\037\250\001\250\021\250!\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\320\004E\300Q\360\014\000\r \230q\330\014(\250\001\330\014\"\240!\2401\330\014$\240A\240Q\340\010\025\220T\320\031+\2501\250A\250Q\340\014\033\2301\320\034R\320RS\330\014\017\210}\230A\230Q\330\020\021\340\014\034\230A\230[\250\002\250.\270\n\300!\330\014\025\220T\230\027\240\001\240\034\320-=\270Q\270a\340\014\017\320\017$\240A\240X\250Q\330\020\035\230Q\230e\2401\330\020 \240\001\240\025\240a\330\020\021\340\014\020\220\001\220\021\360\034\000\t\014\2104\210q\330\014\022\220,\230a\230q\340\010\014\210G\2209\230J\240a\200\001\330\004\n\210+\220Q"; + #else /* compression: none (1797 bytes) */ +const char* const bytes = "Could not allocate hasmapCreate a genesis block first.Index value is out of boundsNo valid nonce foundPyBlock(UTF-8)?disableenablegcisenabledno default __reduce__ due to non-trivial __cinit__src/polluck_blockchain/placeholder_native.pyxBlockchainBlockchain.__reduce_cython__Blockchain.__setstate_cython__Blockchain.create_genesis_blockBlockchain.get_blockBlockchain.new_blockBlockchain.print_key_value_pairPyBlockPyBlock.__reduce_cython__PyBlock.__setstate_cython__PyBlock.bytes_serializePyBlock.minePyBlock.perform_hash__Pyx_PyDict_NextRefTIMEZONE_UTCasyncio.coroutinesblockbytes_serializecline_in_tracebackcreate_genesis_blockdatadatetimedifficultydopt_basicsdopt_basics.datetimeencodefrom_ptrfromtimestamp__func__get_block__getstate__hashhashlibhexidxindex_is_coroutineititems__main__max_noncemine__module____name__new_blocknew_idxnonceperform_hashpolluck_blockchain.placeholder_nativepopprev_blockprev_hashprevious_hashprintprint_key_value_pairpy_block__pyx_state__pyx_vtable____qualname____reduce____reduce_cython____reduce_ex____repr__selfserialize_resserialize_size__set_name__setdefault__setstate____setstate_cython__struct__test__timetimestampvalues0Genesis Blockdummy hash\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\026\220i\230q\240\r\250Q\200A\330\010\013\2104\210t\2201\330\014\022\220,\230a\230q\340\010!\240\024\240\\\260\021\260$\260a\330\010 \240\n\250!\330\010 \240\004\240H\250B\250a\340\010\034\230I\240Q\330\014\r\330\014\017\210q\220\010\230\t\240\021\240&\250\004\250C\250t\2603\260b\270\n\300!\330\014\r\330\014\020\220\007\220q\230\001\330\014\r\330\014\016\210g\220Q\220a\340\010\014\210J\220a\220q\200A\360\010\000\t\n\330\014\034\230D\320 2\260!\2601\260A\330\014\023\220=\240\002\240!\340\014\020\220\001\220\021\200A\330\010\034\230I\240Q\330\014\020\220\001\330\014\017\210q\220\010\230\t\240\021\240&\250\004\250C\250t\2603\260b\270\n\300!\330\014\r\330\014\033""\2307\240!\2401\330\014\017\210w\220a\220q\330\014\016\210g\220Q\220a\340\010\r\210X\220\\\240\027\250\001\250\021\330\010\014\210J\220a\220q\330\010\014\320\014\035\230Q\200A\330\010%\240T\250\027\260\006\260a\340\010\016\210c\220\023\220D\230\007\230t\2401\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\n\000\t\n\330\014\025\220T\230\037\250\001\250\021\250!\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\320\004E\300Q\360\014\000\r \230q\330\014(\250\001\340\010\025\220T\320\031+\2501\250A\250Q\340\r\016\330\014\020\220\t\230\025\230a\230q\330\020 \240\001\240\033\250B\250n\270J\300a\330\020\031\230\024\230W\240A\240\\\3201A\300\021\300!\340\020\023\320\023(\250\001\250\030\260\021\330\024\"\240!\330\024%\240Q\330\024\025\340\020\024\220A\220Q\340\010\013\2104\210q\330\014\022\220,\230a\230q\340\010\014\210G\2209\230J\240a\200\001\330\004\n\210+\220Q"; PyObject *data = NULL; CYTHON_UNUSED_VAR(__Pyx_DecompressString); #endif @@ -9778,10 +9628,10 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { { const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 264}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_difficulty, __pyx_mstate->__pyx_n_u_max_nonce}; - __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_mine, __pyx_mstate->__pyx_kp_b_iso88591_EQ_q_1_AQ_T_1AQ_1_RRS_AQ_A_T_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; + __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_mine, __pyx_mstate->__pyx_kp_b_iso88591_EQ_q_T_1AQ_aq_BnJa_WA_1A_Q_AQ_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 325}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 309}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self}; __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_perform_hash, __pyx_mstate->__pyx_kp_b_iso88591_A_T_wc_xuAV2_b_q_t1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad; } @@ -9796,22 +9646,22 @@ static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) { __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; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 386}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 370}; 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_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_print_key_value_pair, __pyx_mstate->__pyx_kp_b_iso88591_A_T_a_c_D_t1_c_L_1_iq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 408}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 392}; 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[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_get_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4r_3d_D_AQ_D_AQ_iq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 420}; + const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 404}; PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_block}; __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_create_genesis_block, __pyx_mstate->__pyx_kp_b_iso88591_A_IQ_q_Ct3b_7_1_waq_gQa_X_Jaq_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad; } { - const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 433}; + const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 417}; 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_block}; __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_src_polluck_blockchain_placehold, __pyx_mstate->__pyx_n_u_new_block, __pyx_mstate->__pyx_kp_b_iso88591_A_4t1_aq_a_HBa_IQ_q_Ct3b_q_gQa_J, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad; } diff --git a/src/polluck_blockchain/placeholder_native.pyx b/src/polluck_blockchain/placeholder_native.pyx index 3fcac5b..fa5a3b5 100644 --- a/src/polluck_blockchain/placeholder_native.pyx +++ b/src/polluck_blockchain/placeholder_native.pyx @@ -269,24 +269,8 @@ cdef class PyBlock: size_t digest_size bint nonce_found = False int nonce, nonce_solution = 0 - bint *p_nonce_found = &nonce_found - int *p_nonce_solution = &nonce_solution serial_buf = self.bytes_serialize_c(&serialize_size) - - # for nonce in prange(max_nonce, nogil=True, schedule="static", num_threads=16): - # if p_nonce_found[0]: - # break - - # serialize_uint64(serial_buf + NONCE_OFFSET, nonce) - # digest = self.digest(serial_buf, serialize_size, &digest_size) - - # if has_leading_zero_bits(digest, difficulty): - # p_nonce_found[0] = True - # p_nonce_solution[0] = nonce - # break - - # free(digest) with nogil: for nonce in range(max_nonce):