minor fixes
This commit is contained in:
parent
0ab101ecdc
commit
6c109a7354
@ -20,11 +20,7 @@ class ReductionChainMetaFactory(
|
|||||||
AbstractReductionChainMetaFactory[
|
AbstractReductionChainMetaFactory[
|
||||||
Block[
|
Block[
|
||||||
ReductorType,
|
ReductorType,
|
||||||
StateStage[
|
StateStage[ReductorType, AccumulatorType, Reduction[ReductorType, AccumulatorType]]
|
||||||
ReductorType,
|
|
||||||
AccumulatorType,
|
|
||||||
Reduction[ReductorType, AccumulatorType]
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
ReductorType,
|
ReductorType,
|
||||||
AccumulatorType
|
AccumulatorType
|
||||||
@ -39,11 +35,7 @@ class ReductionChainMetaFactory(
|
|||||||
) -> ChainCollectionFactory[
|
) -> ChainCollectionFactory[
|
||||||
Block[
|
Block[
|
||||||
ReductorType,
|
ReductorType,
|
||||||
StateStage[
|
StateStage[ReductorType, AccumulatorType, Reduction[ReductorType, AccumulatorType]]
|
||||||
ReductorType,
|
|
||||||
AccumulatorType,
|
|
||||||
Reduction[ReductorType, AccumulatorType]
|
|
||||||
]
|
|
||||||
],
|
],
|
||||||
ReductorType,
|
ReductorType,
|
||||||
AccumulatorType
|
AccumulatorType
|
||||||
|
@ -19,11 +19,7 @@ AccumulatorType = TypeVar('AccumulatorType')
|
|||||||
class ReductionChainProtocol(
|
class ReductionChainProtocol(
|
||||||
BlockChainProtocol[
|
BlockChainProtocol[
|
||||||
ReductorType,
|
ReductorType,
|
||||||
StateStage[
|
StateStage[ReductorType, AccumulatorType, Reduction[ReductorType, AccumulatorType]],
|
||||||
ReductorType,
|
|
||||||
AccumulatorType,
|
|
||||||
Reduction[ReductorType, AccumulatorType]
|
|
||||||
],
|
|
||||||
AccumulatorType
|
AccumulatorType
|
||||||
]
|
]
|
||||||
):
|
):
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
from typing import TypeVar
|
|
||||||
|
|
||||||
from rainbowadn.hashing.hashpoint import HashPoint
|
|
||||||
from rainbowadn.hashing.hashresolver import HashResolver
|
|
||||||
from rainbowadn.hashing.nullability.nullablereference import NullableReference
|
|
||||||
|
|
||||||
__all__ = ('reduce_nullable_reference',)
|
|
||||||
|
|
||||||
ReReferencedType = TypeVar('ReReferencedType')
|
|
||||||
|
|
||||||
|
|
||||||
def reduce_nullable_reference(
|
|
||||||
reference: NullableReference[NullableReference[ReReferencedType]],
|
|
||||||
resolver: HashResolver
|
|
||||||
) -> NullableReference[ReReferencedType]:
|
|
||||||
assert isinstance(reference, NullableReference)
|
|
||||||
assert isinstance(resolver, HashResolver)
|
|
||||||
if reference.reference.null():
|
|
||||||
return reference.factory.from_bytes(HashPoint.NULL_HASH, resolver)
|
|
||||||
else:
|
|
||||||
return reference.reference.resolve().resolve()
|
|
0
rainbowadn/storage/__init__.py
Normal file
0
rainbowadn/storage/__init__.py
Normal file
2
rainbowadn/storage/storage.py
Normal file
2
rainbowadn/storage/storage.py
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
class Storage:
|
||||||
|
pass
|
@ -108,6 +108,7 @@ class TestAll(unittest.TestCase):
|
|||||||
assert not btree.contains(key)
|
assert not btree.contains(key)
|
||||||
btree = btree.add(key)
|
btree = btree.add(key)
|
||||||
assert btree.contains(key)
|
assert btree.contains(key)
|
||||||
|
print(btree.height)
|
||||||
measure('resolve and add')
|
measure('resolve and add')
|
||||||
|
|
||||||
def test_wrisbt_index(self):
|
def test_wrisbt_index(self):
|
||||||
|
@ -159,10 +159,9 @@ class TransactionData(RecursiveMentionable, StaticMentionable):
|
|||||||
assert isinstance(owner, Subject)
|
assert isinstance(owner, Subject)
|
||||||
signature: Signature = signatures_stack.element.resolve()
|
signature: Signature = signatures_stack.element.resolve()
|
||||||
assert isinstance(signature, Signature)
|
assert isinstance(signature, Signature)
|
||||||
return signature.verify(
|
assert signature.verify(owner, self.hash_point)
|
||||||
owner,
|
assert self._verify_signatures(in_coins_stack.previous, signatures_stack.previous)
|
||||||
self.hash_point
|
return True
|
||||||
)
|
|
||||||
|
|
||||||
def iter_in_coins(self) -> Iterable[HashPoint[Coin]]:
|
def iter_in_coins(self) -> Iterable[HashPoint[Coin]]:
|
||||||
in_coins: NullableReference[Stack[Coin]] = self.in_coins
|
in_coins: NullableReference[Stack[Coin]] = self.in_coins
|
||||||
|
Loading…
Reference in New Issue
Block a user