 		power = 70
 		damages = null
 
-		userHP = -> query.val 'SELECT health FROM characters WHERE id=1'
-		totalStr = -> query.val 'SELECT SUM(strength) FROM items'
+		userHP = (tx) -> queryUtils.getFor(tx).val 'SELECT health FROM characters WHERE id=1'
+		totalStr = (tx) -> queryUtils.getFor(tx).val 'SELECT SUM(strength) FROM items'
 
 		performSomeAttacks = ->
 			damages = {}
 			tx = transaction(conn)
 			for i in [0..20]
-				prevHP = userHP()
-				prevSt = totalStr()
+				prevHP = userHP(tx)
+				prevSt = totalStr(tx)
 
 				hp = game._hitAndGetHealth tx, 1, power
 				dmg = prevHP - hp
 				damages[dmg] = true
 
 				if dmg is 0
-					test.ok prevSt > totalStr(), 'should reduce armor strength if damage was blocked'
+					test.ok prevSt > totalStr(tx), 'should reduce armor strength if damage was blocked'
 			tx.rollback.sync(tx)
-
 
 		insert 'items_proto', id:1, name: 'breastplate', coverage:25
 		insert 'items_proto', id:2, name: 'greave', coverage:25

		insert 'items', id:20, prototype:2, owner:1, strength:100, equipped: true

		power = 120
		shield = -> query.row('SELECT strength FROM items WHERE id=10')
		greave = -> query.row('SELECT strength FROM items WHERE id=20')

		# shield with 100% coverage
		for i in [0...5]
			tx = transaction(conn)
			hp = game._hitAndGetHealth tx, 1, power
			test.strictEqual hp, 1000, 'both shield and armor should block damage'
			test.strictEqual shield().strength, 0, 'shield should block damage first'
			test.strictEqual greave().strength, 80, 'armor should block damage not blocked by shield'
			tx.rollback.sync(tx)

		# shield with 50% coverage

		for i in [0...40]
			tx = transaction(conn)
			hp = game._hitAndGetHealth tx, 1, power
			test.strictEqual shield(tx).strength, 1000, "shield should not block anything if it's coverage is 0%"
			tx.rollback.sync(tx)

		# shield is not equipped
