#NEWLINE# def test_receive_proposal( ) : #NEWLINE# #INDENT# app = AppMock ( privkeys [ 0 ] ) #NEWLINE# chainservice = hdc_service . ChainService ( app ) #NEWLINE# proto = hdc_protocol . HDCProtocol ( PeerMock ( app ) , chainservice ) #NEWLINE# cm = chainservice . consensus_manager #NEWLINE# p = cm . active_round . mk_proposal ( ) #NEWLINE# assert isinstance ( p . block , Block ) #NEWLINE# r = rlp . encode ( p ) #NEWLINE# p = rlp . decode ( p , sedes = BlockProposal ) #NEWLINE# assert isinstance ( p . block , TransientBlock ) #NEWLINE# with pytest . raises ( InvalidProposalError ) : #NEWLINE# #INDENT# chainservice . on_receive_newblockproposal ( proto , p )