Transaction: improve hash length checking + tests