Ad
  • Default User Avatar

    because Counter is subclass of dict..try isinstance(a,b) it will handle inheritance

  • Custom User Avatar

    Why in this test exception should not be raised?

    return_types = (<class 'dict'>,) 
    return_something's output = Counter({'e': 2, 'r': 1})  # type(output) = <class 'collections.Counter'>
    

    Counter class is a dict subclass, not dict in itself.

    The same in random tests:

    return_types = (<class 'tuple'>, <class 'collections.abc.Iterable'>, <class 'set'>, <class 'str'>, <class 'function'>, <class 'dict'>, <class 'collections.deque'>, <class 'int'>)
    return_something's output = Counter({'d': 2, 'r': 1, 't': 1, 's': 1, 'g': 1})  # type(output) = <class 'collections.Counter'>
    

    According to tests, exception also should not be raised.

    Why?

  • Custom User Avatar

    Hi

    Input hashes are in MSB

    tx_hashes = ["8347cee4a1cb5ad1bb0d92e86e6612dbf6cfc7649c9964f210d4069b426e720a","a16f3ce4dd5deb92d98ef5cf8afeaf0775ebca408f708b2146c4fb42b41e14be"]

    So, you should convert it into LSB and then calculate hash(tx0_LSB) and hash(tx1_LSB) at the first step

    Notice, you should convert hash(tx0_LSB) into LSB too

  • Custom User Avatar

    'LSB(least significant bit) convention is used, all hashes must be converted from MSB to LSB'

    Could you explain what does this sentence means ? How should I understand it ?

    So hashes, which are passed to function are in MSB convention? And they should be converted to LSB before concatenation?