pc-dart icon indicating copy to clipboard operation
pc-dart copied to clipboard

ECCurve_secp256k1 constructor fails with nullsafety violation

Open morrica opened this issue 4 years ago • 2 comments

Using version 3.0.0-nullsafety.2

The following fails with a nullsafety violation: ECDomainParameters _domainParameters = ECCurve_secp256k1();

Relevant error:

dart:core                                                          _TypeError._throwNew
package:pointycastle/src/ec_standard_curve_constructor.dart 20:21  constructFpStandardCurve
package:pointycastle/ecc/curves/secp256k1.dart 15:34               new ECCurve_secp256k1
package:my_package/src/crypto.dart 9:46                           _domainParameters

type 'Null' is not a subtype of type 'List<int>' of 'seed'

It looks like null is specifically being passed into the non-nullable List<int> seed parameter of the ECCurve_secp256k1._make() method in the secp256k1.dart file.

Pointycastle is holding up the migration to null-safety for my library so I'm eager to see a release version. Appreciate all the effort. :-)

morrica avatar Mar 15 '21 20:03 morrica

Looks like this was probably already fixed in the latest github code. The fix just hasn't been published to pub.dev yet. Will await that new version on pub.dev.

morrica avatar Mar 15 '21 20:03 morrica

The new version was published yesterday (so you should be good to go).

AKushWarrior avatar Mar 24 '21 17:03 AKushWarrior