Smart's attack for secp256k1 does not work
The question is referring to Nigel P. Smart's The Discrete Logarithm Problem on Elliptic Curves of Trace One, in Journal of Cryptology (1999) (earlier version). Quoting the intro:

(…) we describe an elementary technique which leads to a linear algorithm for solving the discrete logarithm problem on elliptic curves of trace one. In practice, the method described means that when choosing elliptic curves to use in cryptography one has to eliminate all curves whose group orders are equal to the order of the finite field.

Trace of an Elliptic Curve: For an elliptic curve $E$ defined over $F_q$ with $\#E(F_q) = q+1−t$. The $t$ is called the trace of $E$.
In the specification of secp256k1 it is apparent that $n$ (the curve's order¹,²) is not equal to $p$ (the order¹,³ of the base field). In other words, the trace $t=p-n+1$ is not $1$.
Thus Smart's attack can't apply to secp256k1.

Off-topic note: assertions are there to stop execution before code does a silly thing. Removing an assertion without other code change working around the asserted limitation is seldom a good idea.

¹ The order of a finite group or finite field is how many elements it has.
² That order is the number $\#E(F_q)$ of points on the elliptic curve including the neutral &quot;point at infinity&quot;.
³ That order is $p=q$, the prime modulus. The finite field considered is integers modulo $p$, noted $(\Bbb Z_p,+,\cdot)$, equivalently $F_q$.