minor fixes
This commit is contained in:
parent
0ab101ecdc
commit
6c109a7354
@ -20,11 +20,7 @@ class ReductionChainMetaFactory(
|
||||
AbstractReductionChainMetaFactory[
|
||||
Block[
|
||||
ReductorType,
|
||||
StateStage[
|
||||
ReductorType,
|
||||
AccumulatorType,
|
||||
Reduction[ReductorType, AccumulatorType]
|
||||
]
|
||||
StateStage[ReductorType, AccumulatorType, Reduction[ReductorType, AccumulatorType]]
|
||||
],
|
||||
ReductorType,
|
||||
AccumulatorType
|
||||
@ -39,11 +35,7 @@ class ReductionChainMetaFactory(
|
||||
) -> ChainCollectionFactory[
|
||||
Block[
|
||||
ReductorType,
|
||||
StateStage[
|
||||
ReductorType,
|
||||
AccumulatorType,
|
||||
Reduction[ReductorType, AccumulatorType]
|
||||
]
|
||||
StateStage[ReductorType, AccumulatorType, Reduction[ReductorType, AccumulatorType]]
|
||||
],
|
||||
ReductorType,
|
||||
AccumulatorType
|
||||
|
@ -19,11 +19,7 @@ AccumulatorType = TypeVar('AccumulatorType')
|
||||
class ReductionChainProtocol(
|
||||
BlockChainProtocol[
|
||||
ReductorType,
|
||||
StateStage[
|
||||
ReductorType,
|
||||
AccumulatorType,
|
||||
Reduction[ReductorType, AccumulatorType]
|
||||
],
|
||||
StateStage[ReductorType, AccumulatorType, Reduction[ReductorType, 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)
|
||||
btree = btree.add(key)
|
||||
assert btree.contains(key)
|
||||
print(btree.height)
|
||||
measure('resolve and add')
|
||||
|
||||
def test_wrisbt_index(self):
|
||||
|
@ -159,10 +159,9 @@ class TransactionData(RecursiveMentionable, StaticMentionable):
|
||||
assert isinstance(owner, Subject)
|
||||
signature: Signature = signatures_stack.element.resolve()
|
||||
assert isinstance(signature, Signature)
|
||||
return signature.verify(
|
||||
owner,
|
||||
self.hash_point
|
||||
)
|
||||
assert signature.verify(owner, self.hash_point)
|
||||
assert self._verify_signatures(in_coins_stack.previous, signatures_stack.previous)
|
||||
return True
|
||||
|
||||
def iter_in_coins(self) -> Iterable[HashPoint[Coin]]:
|
||||
in_coins: NullableReference[Stack[Coin]] = self.in_coins
|
||||
|
Loading…
Reference in New Issue
Block a user