You need to just reorder your lines of code.
integer counter;
should be placed before
a_tx = adder_transaction::type_id::create(.name("a_tx"), .contxt(get_full_name()));
But one more point, your code inside the run_phase did not make much sense to me, as counter would never be incremented higher than 1. Just a heads up!!
- Ashith