minor fixes

This commit is contained in:
AF 2022-05-24 02:32:15 +03:00
parent 0ab101ecdc
commit 6c109a7354
7 changed files with 9 additions and 40 deletions

View File

@ -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

View File

@ -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
] ]
): ):

View File

@ -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()

View File

View File

@ -0,0 +1,2 @@
class Storage:
pass

View File

@ -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):

View File

@ -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