chainDebug and tests added