fix: make history work on completted transaction only and make test cases better