debugging work

This commit is contained in:
Christien Rioux 2025-03-22 21:43:37 -04:00
parent 739df7c427
commit d6b1c20906
71 changed files with 4155 additions and 3616 deletions

View file

@ -8,7 +8,7 @@ part 'account_record_info.g.dart';
/// AccountRecordInfo is the key and owner info for the account dht record that
/// is stored in the identity instance record
@freezed
class AccountRecordInfo with _$AccountRecordInfo {
sealed class AccountRecordInfo with _$AccountRecordInfo {
const factory AccountRecordInfo({
// Top level account keys and secrets
required OwnedDHTRecordPointer accountRecord,

View file

@ -1,3 +1,4 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@ -9,137 +10,30 @@ part of 'account_record_info.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
AccountRecordInfo _$AccountRecordInfoFromJson(Map<String, dynamic> json) {
return _AccountRecordInfo.fromJson(json);
}
/// @nodoc
mixin _$AccountRecordInfo {
// Top level account keys and secrets
OwnedDHTRecordPointer get accountRecord => throw _privateConstructorUsedError;
/// Serializes this AccountRecordInfo to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
OwnedDHTRecordPointer get accountRecord;
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$AccountRecordInfoCopyWith<AccountRecordInfo> get copyWith =>
throw _privateConstructorUsedError;
}
_$AccountRecordInfoCopyWithImpl<AccountRecordInfo>(
this as AccountRecordInfo, _$identity);
/// @nodoc
abstract class $AccountRecordInfoCopyWith<$Res> {
factory $AccountRecordInfoCopyWith(
AccountRecordInfo value, $Res Function(AccountRecordInfo) then) =
_$AccountRecordInfoCopyWithImpl<$Res, AccountRecordInfo>;
@useResult
$Res call({OwnedDHTRecordPointer accountRecord});
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord;
}
/// @nodoc
class _$AccountRecordInfoCopyWithImpl<$Res, $Val extends AccountRecordInfo>
implements $AccountRecordInfoCopyWith<$Res> {
_$AccountRecordInfoCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? accountRecord = null,
}) {
return _then(_value.copyWith(
accountRecord: null == accountRecord
? _value.accountRecord
: accountRecord // ignore: cast_nullable_to_non_nullable
as OwnedDHTRecordPointer,
) as $Val);
}
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord {
return $OwnedDHTRecordPointerCopyWith<$Res>(_value.accountRecord, (value) {
return _then(_value.copyWith(accountRecord: value) as $Val);
});
}
}
/// @nodoc
abstract class _$$AccountRecordInfoImplCopyWith<$Res>
implements $AccountRecordInfoCopyWith<$Res> {
factory _$$AccountRecordInfoImplCopyWith(_$AccountRecordInfoImpl value,
$Res Function(_$AccountRecordInfoImpl) then) =
__$$AccountRecordInfoImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({OwnedDHTRecordPointer accountRecord});
@override
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord;
}
/// @nodoc
class __$$AccountRecordInfoImplCopyWithImpl<$Res>
extends _$AccountRecordInfoCopyWithImpl<$Res, _$AccountRecordInfoImpl>
implements _$$AccountRecordInfoImplCopyWith<$Res> {
__$$AccountRecordInfoImplCopyWithImpl(_$AccountRecordInfoImpl _value,
$Res Function(_$AccountRecordInfoImpl) _then)
: super(_value, _then);
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? accountRecord = null,
}) {
return _then(_$AccountRecordInfoImpl(
accountRecord: null == accountRecord
? _value.accountRecord
: accountRecord // ignore: cast_nullable_to_non_nullable
as OwnedDHTRecordPointer,
));
}
}
/// @nodoc
@JsonSerializable()
class _$AccountRecordInfoImpl implements _AccountRecordInfo {
const _$AccountRecordInfoImpl({required this.accountRecord});
factory _$AccountRecordInfoImpl.fromJson(Map<String, dynamic> json) =>
_$$AccountRecordInfoImplFromJson(json);
// Top level account keys and secrets
@override
final OwnedDHTRecordPointer accountRecord;
@override
String toString() {
return 'AccountRecordInfo(accountRecord: $accountRecord)';
}
/// Serializes this AccountRecordInfo to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$AccountRecordInfoImpl &&
other is AccountRecordInfo &&
(identical(other.accountRecord, accountRecord) ||
other.accountRecord == accountRecord));
}
@ -148,39 +42,148 @@ class _$AccountRecordInfoImpl implements _AccountRecordInfo {
@override
int get hashCode => Object.hash(runtimeType, accountRecord);
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$AccountRecordInfoImplCopyWith<_$AccountRecordInfoImpl> get copyWith =>
__$$AccountRecordInfoImplCopyWithImpl<_$AccountRecordInfoImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$AccountRecordInfoImplToJson(
this,
);
String toString() {
return 'AccountRecordInfo(accountRecord: $accountRecord)';
}
}
abstract class _AccountRecordInfo implements AccountRecordInfo {
const factory _AccountRecordInfo(
{required final OwnedDHTRecordPointer accountRecord}) =
_$AccountRecordInfoImpl;
/// @nodoc
abstract mixin class $AccountRecordInfoCopyWith<$Res> {
factory $AccountRecordInfoCopyWith(
AccountRecordInfo value, $Res Function(AccountRecordInfo) _then) =
_$AccountRecordInfoCopyWithImpl;
@useResult
$Res call({OwnedDHTRecordPointer accountRecord});
factory _AccountRecordInfo.fromJson(Map<String, dynamic> json) =
_$AccountRecordInfoImpl.fromJson;
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord;
}
/// @nodoc
class _$AccountRecordInfoCopyWithImpl<$Res>
implements $AccountRecordInfoCopyWith<$Res> {
_$AccountRecordInfoCopyWithImpl(this._self, this._then);
final AccountRecordInfo _self;
final $Res Function(AccountRecordInfo) _then;
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? accountRecord = null,
}) {
return _then(_self.copyWith(
accountRecord: null == accountRecord
? _self.accountRecord
: accountRecord // ignore: cast_nullable_to_non_nullable
as OwnedDHTRecordPointer,
));
}
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord {
return $OwnedDHTRecordPointerCopyWith<$Res>(_self.accountRecord, (value) {
return _then(_self.copyWith(accountRecord: value));
});
}
}
/// @nodoc
@JsonSerializable()
class _AccountRecordInfo implements AccountRecordInfo {
const _AccountRecordInfo({required this.accountRecord});
factory _AccountRecordInfo.fromJson(Map<String, dynamic> json) =>
_$AccountRecordInfoFromJson(json);
// Top level account keys and secrets
@override
OwnedDHTRecordPointer get accountRecord;
final OwnedDHTRecordPointer accountRecord;
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$AccountRecordInfoImplCopyWith<_$AccountRecordInfoImpl> get copyWith =>
throw _privateConstructorUsedError;
@pragma('vm:prefer-inline')
_$AccountRecordInfoCopyWith<_AccountRecordInfo> get copyWith =>
__$AccountRecordInfoCopyWithImpl<_AccountRecordInfo>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$AccountRecordInfoToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _AccountRecordInfo &&
(identical(other.accountRecord, accountRecord) ||
other.accountRecord == accountRecord));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, accountRecord);
@override
String toString() {
return 'AccountRecordInfo(accountRecord: $accountRecord)';
}
}
/// @nodoc
abstract mixin class _$AccountRecordInfoCopyWith<$Res>
implements $AccountRecordInfoCopyWith<$Res> {
factory _$AccountRecordInfoCopyWith(
_AccountRecordInfo value, $Res Function(_AccountRecordInfo) _then) =
__$AccountRecordInfoCopyWithImpl;
@override
@useResult
$Res call({OwnedDHTRecordPointer accountRecord});
@override
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord;
}
/// @nodoc
class __$AccountRecordInfoCopyWithImpl<$Res>
implements _$AccountRecordInfoCopyWith<$Res> {
__$AccountRecordInfoCopyWithImpl(this._self, this._then);
final _AccountRecordInfo _self;
final $Res Function(_AccountRecordInfo) _then;
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? accountRecord = null,
}) {
return _then(_AccountRecordInfo(
accountRecord: null == accountRecord
? _self.accountRecord
: accountRecord // ignore: cast_nullable_to_non_nullable
as OwnedDHTRecordPointer,
));
}
/// Create a copy of AccountRecordInfo
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$OwnedDHTRecordPointerCopyWith<$Res> get accountRecord {
return $OwnedDHTRecordPointerCopyWith<$Res>(_self.accountRecord, (value) {
return _then(_self.copyWith(accountRecord: value));
});
}
}
// dart format on

View file

@ -6,14 +6,12 @@ part of 'account_record_info.dart';
// JsonSerializableGenerator
// **************************************************************************
_$AccountRecordInfoImpl _$$AccountRecordInfoImplFromJson(
Map<String, dynamic> json) =>
_$AccountRecordInfoImpl(
_AccountRecordInfo _$AccountRecordInfoFromJson(Map<String, dynamic> json) =>
_AccountRecordInfo(
accountRecord: OwnedDHTRecordPointer.fromJson(json['account_record']),
);
Map<String, dynamic> _$$AccountRecordInfoImplToJson(
_$AccountRecordInfoImpl instance) =>
Map<String, dynamic> _$AccountRecordInfoToJson(_AccountRecordInfo instance) =>
<String, dynamic>{
'account_record': instance.accountRecord.toJson(),
};

View file

@ -14,7 +14,7 @@ part 'identity.g.dart';
/// DHT Secret: IdentityInstance Secret Key (stored encrypted with unlock code
/// in local table store)
@freezed
class Identity with _$Identity {
sealed class Identity with _$Identity {
const factory Identity({
// Top level account keys and secrets
required IMap<String, ISet<AccountRecordInfo>> accountRecords,

View file

@ -1,3 +1,4 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@ -9,122 +10,29 @@ part of 'identity.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
Identity _$IdentityFromJson(Map<String, dynamic> json) {
return _Identity.fromJson(json);
}
/// @nodoc
mixin _$Identity {
// Top level account keys and secrets
IMap<String, ISet<AccountRecordInfo>> get accountRecords =>
throw _privateConstructorUsedError;
/// Serializes this Identity to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
IMap<String, ISet<AccountRecordInfo>> get accountRecords;
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$IdentityCopyWith<Identity> get copyWith =>
throw _privateConstructorUsedError;
}
_$IdentityCopyWithImpl<Identity>(this as Identity, _$identity);
/// @nodoc
abstract class $IdentityCopyWith<$Res> {
factory $IdentityCopyWith(Identity value, $Res Function(Identity) then) =
_$IdentityCopyWithImpl<$Res, Identity>;
@useResult
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
}
/// @nodoc
class _$IdentityCopyWithImpl<$Res, $Val extends Identity>
implements $IdentityCopyWith<$Res> {
_$IdentityCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? accountRecords = null,
}) {
return _then(_value.copyWith(
accountRecords: null == accountRecords
? _value.accountRecords
: accountRecords // ignore: cast_nullable_to_non_nullable
as IMap<String, ISet<AccountRecordInfo>>,
) as $Val);
}
}
/// @nodoc
abstract class _$$IdentityImplCopyWith<$Res>
implements $IdentityCopyWith<$Res> {
factory _$$IdentityImplCopyWith(
_$IdentityImpl value, $Res Function(_$IdentityImpl) then) =
__$$IdentityImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
}
/// @nodoc
class __$$IdentityImplCopyWithImpl<$Res>
extends _$IdentityCopyWithImpl<$Res, _$IdentityImpl>
implements _$$IdentityImplCopyWith<$Res> {
__$$IdentityImplCopyWithImpl(
_$IdentityImpl _value, $Res Function(_$IdentityImpl) _then)
: super(_value, _then);
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? accountRecords = null,
}) {
return _then(_$IdentityImpl(
accountRecords: null == accountRecords
? _value.accountRecords
: accountRecords // ignore: cast_nullable_to_non_nullable
as IMap<String, ISet<AccountRecordInfo>>,
));
}
}
/// @nodoc
@JsonSerializable()
class _$IdentityImpl implements _Identity {
const _$IdentityImpl({required this.accountRecords});
factory _$IdentityImpl.fromJson(Map<String, dynamic> json) =>
_$$IdentityImplFromJson(json);
// Top level account keys and secrets
@override
final IMap<String, ISet<AccountRecordInfo>> accountRecords;
@override
String toString() {
return 'Identity(accountRecords: $accountRecords)';
}
/// Serializes this Identity to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$IdentityImpl &&
other is Identity &&
(identical(other.accountRecords, accountRecords) ||
other.accountRecords == accountRecords));
}
@ -133,38 +41,119 @@ class _$IdentityImpl implements _Identity {
@override
int get hashCode => Object.hash(runtimeType, accountRecords);
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$IdentityImplCopyWith<_$IdentityImpl> get copyWith =>
__$$IdentityImplCopyWithImpl<_$IdentityImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$IdentityImplToJson(
this,
);
String toString() {
return 'Identity(accountRecords: $accountRecords)';
}
}
abstract class _Identity implements Identity {
const factory _Identity(
{required final IMap<String, ISet<AccountRecordInfo>>
accountRecords}) = _$IdentityImpl;
/// @nodoc
abstract mixin class $IdentityCopyWith<$Res> {
factory $IdentityCopyWith(Identity value, $Res Function(Identity) _then) =
_$IdentityCopyWithImpl;
@useResult
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
}
factory _Identity.fromJson(Map<String, dynamic> json) =
_$IdentityImpl.fromJson;
/// @nodoc
class _$IdentityCopyWithImpl<$Res> implements $IdentityCopyWith<$Res> {
_$IdentityCopyWithImpl(this._self, this._then);
final Identity _self;
final $Res Function(Identity) _then;
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? accountRecords = null,
}) {
return _then(_self.copyWith(
accountRecords: null == accountRecords
? _self.accountRecords
: accountRecords // ignore: cast_nullable_to_non_nullable
as IMap<String, ISet<AccountRecordInfo>>,
));
}
}
/// @nodoc
@JsonSerializable()
class _Identity implements Identity {
const _Identity({required this.accountRecords});
factory _Identity.fromJson(Map<String, dynamic> json) =>
_$IdentityFromJson(json);
// Top level account keys and secrets
@override
IMap<String, ISet<AccountRecordInfo>> get accountRecords;
final IMap<String, ISet<AccountRecordInfo>> accountRecords;
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$IdentityImplCopyWith<_$IdentityImpl> get copyWith =>
throw _privateConstructorUsedError;
@pragma('vm:prefer-inline')
_$IdentityCopyWith<_Identity> get copyWith =>
__$IdentityCopyWithImpl<_Identity>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$IdentityToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _Identity &&
(identical(other.accountRecords, accountRecords) ||
other.accountRecords == accountRecords));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType, accountRecords);
@override
String toString() {
return 'Identity(accountRecords: $accountRecords)';
}
}
/// @nodoc
abstract mixin class _$IdentityCopyWith<$Res>
implements $IdentityCopyWith<$Res> {
factory _$IdentityCopyWith(_Identity value, $Res Function(_Identity) _then) =
__$IdentityCopyWithImpl;
@override
@useResult
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
}
/// @nodoc
class __$IdentityCopyWithImpl<$Res> implements _$IdentityCopyWith<$Res> {
__$IdentityCopyWithImpl(this._self, this._then);
final _Identity _self;
final $Res Function(_Identity) _then;
/// Create a copy of Identity
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$Res call({
Object? accountRecords = null,
}) {
return _then(_Identity(
accountRecords: null == accountRecords
? _self.accountRecords
: accountRecords // ignore: cast_nullable_to_non_nullable
as IMap<String, ISet<AccountRecordInfo>>,
));
}
}
// dart format on

View file

@ -6,8 +6,7 @@ part of 'identity.dart';
// JsonSerializableGenerator
// **************************************************************************
_$IdentityImpl _$$IdentityImplFromJson(Map<String, dynamic> json) =>
_$IdentityImpl(
_Identity _$IdentityFromJson(Map<String, dynamic> json) => _Identity(
accountRecords: IMap<String, ISet<AccountRecordInfo>>.fromJson(
json['account_records'] as Map<String, dynamic>,
(value) => value as String,
@ -15,8 +14,7 @@ _$IdentityImpl _$$IdentityImplFromJson(Map<String, dynamic> json) =>
value, (value) => AccountRecordInfo.fromJson(value))),
);
Map<String, dynamic> _$$IdentityImplToJson(_$IdentityImpl instance) =>
<String, dynamic>{
Map<String, dynamic> _$IdentityToJson(_Identity instance) => <String, dynamic>{
'account_records': instance.accountRecords.toJson(
(value) => value,
(value) => value.toJson(

View file

@ -10,7 +10,7 @@ part 'identity_instance.freezed.dart';
part 'identity_instance.g.dart';
@freezed
class IdentityInstance with _$IdentityInstance {
sealed class IdentityInstance with _$IdentityInstance {
const factory IdentityInstance({
// Private DHT record storing identity account mapping
required TypedKey recordKey,

View file

@ -1,3 +1,4 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@ -9,112 +10,76 @@ part of 'identity_instance.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
IdentityInstance _$IdentityInstanceFromJson(Map<String, dynamic> json) {
return _IdentityInstance.fromJson(json);
}
/// @nodoc
mixin _$IdentityInstance {
// Private DHT record storing identity account mapping
Typed<FixedEncodedString43> get recordKey =>
throw _privateConstructorUsedError; // Public key of identity instance
FixedEncodedString43 get publicKey =>
throw _privateConstructorUsedError; // Secret key of identity instance
TypedKey get recordKey; // Public key of identity instance
PublicKey get publicKey; // Secret key of identity instance
// Encrypted with appended salt, key is DeriveSharedSecret(
// password = SuperIdentity.secret,
// salt = publicKey)
// Used to recover accounts without generating a new instance
@Uint8ListJsonConverter()
Uint8List get encryptedSecretKey =>
throw _privateConstructorUsedError; // Signature of SuperInstance recordKey and SuperInstance publicKey
Uint8List
get encryptedSecretKey; // Signature of SuperInstance recordKey and SuperInstance publicKey
// by publicKey
FixedEncodedString86 get superSignature =>
throw _privateConstructorUsedError; // Signature of recordKey, publicKey, encryptedSecretKey, and superSignature
Signature
get superSignature; // Signature of recordKey, publicKey, encryptedSecretKey, and superSignature
// by SuperIdentity publicKey
FixedEncodedString86 get signature => throw _privateConstructorUsedError;
/// Serializes this IdentityInstance to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Signature get signature;
/// Create a copy of IdentityInstance
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
$IdentityInstanceCopyWith<IdentityInstance> get copyWith =>
throw _privateConstructorUsedError;
}
/// @nodoc
abstract class $IdentityInstanceCopyWith<$Res> {
factory $IdentityInstanceCopyWith(
IdentityInstance value, $Res Function(IdentityInstance) then) =
_$IdentityInstanceCopyWithImpl<$Res, IdentityInstance>;
@useResult
$Res call(
{Typed<FixedEncodedString43> recordKey,
FixedEncodedString43 publicKey,
@Uint8ListJsonConverter() Uint8List encryptedSecretKey,
FixedEncodedString86 superSignature,
FixedEncodedString86 signature});
}
/// @nodoc
class _$IdentityInstanceCopyWithImpl<$Res, $Val extends IdentityInstance>
implements $IdentityInstanceCopyWith<$Res> {
_$IdentityInstanceCopyWithImpl(this._value, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
/// Create a copy of IdentityInstance
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
$IdentityInstanceCopyWith<IdentityInstance> get copyWith =>
_$IdentityInstanceCopyWithImpl<IdentityInstance>(
this as IdentityInstance, _$identity);
/// Serializes this IdentityInstance to a JSON map.
Map<String, dynamic> toJson();
@override
$Res call({
Object? recordKey = null,
Object? publicKey = null,
Object? encryptedSecretKey = null,
Object? superSignature = null,
Object? signature = null,
}) {
return _then(_value.copyWith(
recordKey: null == recordKey
? _value.recordKey
: recordKey // ignore: cast_nullable_to_non_nullable
as Typed<FixedEncodedString43>,
publicKey: null == publicKey
? _value.publicKey
: publicKey // ignore: cast_nullable_to_non_nullable
as FixedEncodedString43,
encryptedSecretKey: null == encryptedSecretKey
? _value.encryptedSecretKey
: encryptedSecretKey // ignore: cast_nullable_to_non_nullable
as Uint8List,
superSignature: null == superSignature
? _value.superSignature
: superSignature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
signature: null == signature
? _value.signature
: signature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
) as $Val);
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is IdentityInstance &&
(identical(other.recordKey, recordKey) ||
other.recordKey == recordKey) &&
(identical(other.publicKey, publicKey) ||
other.publicKey == publicKey) &&
const DeepCollectionEquality()
.equals(other.encryptedSecretKey, encryptedSecretKey) &&
(identical(other.superSignature, superSignature) ||
other.superSignature == superSignature) &&
(identical(other.signature, signature) ||
other.signature == signature));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
recordKey,
publicKey,
const DeepCollectionEquality().hash(encryptedSecretKey),
superSignature,
signature);
@override
String toString() {
return 'IdentityInstance(recordKey: $recordKey, publicKey: $publicKey, encryptedSecretKey: $encryptedSecretKey, superSignature: $superSignature, signature: $signature)';
}
}
/// @nodoc
abstract class _$$IdentityInstanceImplCopyWith<$Res>
implements $IdentityInstanceCopyWith<$Res> {
factory _$$IdentityInstanceImplCopyWith(_$IdentityInstanceImpl value,
$Res Function(_$IdentityInstanceImpl) then) =
__$$IdentityInstanceImplCopyWithImpl<$Res>;
@override
abstract mixin class $IdentityInstanceCopyWith<$Res> {
factory $IdentityInstanceCopyWith(
IdentityInstance value, $Res Function(IdentityInstance) _then) =
_$IdentityInstanceCopyWithImpl;
@useResult
$Res call(
{Typed<FixedEncodedString43> recordKey,
@ -125,12 +90,12 @@ abstract class _$$IdentityInstanceImplCopyWith<$Res>
}
/// @nodoc
class __$$IdentityInstanceImplCopyWithImpl<$Res>
extends _$IdentityInstanceCopyWithImpl<$Res, _$IdentityInstanceImpl>
implements _$$IdentityInstanceImplCopyWith<$Res> {
__$$IdentityInstanceImplCopyWithImpl(_$IdentityInstanceImpl _value,
$Res Function(_$IdentityInstanceImpl) _then)
: super(_value, _then);
class _$IdentityInstanceCopyWithImpl<$Res>
implements $IdentityInstanceCopyWith<$Res> {
_$IdentityInstanceCopyWithImpl(this._self, this._then);
final IdentityInstance _self;
final $Res Function(IdentityInstance) _then;
/// Create a copy of IdentityInstance
/// with the given fields replaced by the non-null parameter values.
@ -143,25 +108,25 @@ class __$$IdentityInstanceImplCopyWithImpl<$Res>
Object? superSignature = null,
Object? signature = null,
}) {
return _then(_$IdentityInstanceImpl(
return _then(_self.copyWith(
recordKey: null == recordKey
? _value.recordKey
? _self.recordKey!
: recordKey // ignore: cast_nullable_to_non_nullable
as Typed<FixedEncodedString43>,
publicKey: null == publicKey
? _value.publicKey
? _self.publicKey!
: publicKey // ignore: cast_nullable_to_non_nullable
as FixedEncodedString43,
encryptedSecretKey: null == encryptedSecretKey
? _value.encryptedSecretKey
? _self.encryptedSecretKey
: encryptedSecretKey // ignore: cast_nullable_to_non_nullable
as Uint8List,
superSignature: null == superSignature
? _value.superSignature
? _self.superSignature!
: superSignature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
signature: null == signature
? _value.signature
? _self.signature!
: signature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
));
@ -170,17 +135,16 @@ class __$$IdentityInstanceImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
class _$IdentityInstanceImpl extends _IdentityInstance {
const _$IdentityInstanceImpl(
class _IdentityInstance extends IdentityInstance {
const _IdentityInstance(
{required this.recordKey,
required this.publicKey,
@Uint8ListJsonConverter() required this.encryptedSecretKey,
required this.superSignature,
required this.signature})
: super._();
factory _$IdentityInstanceImpl.fromJson(Map<String, dynamic> json) =>
_$$IdentityInstanceImplFromJson(json);
factory _IdentityInstance.fromJson(Map<String, dynamic> json) =>
_$IdentityInstanceFromJson(json);
// Private DHT record storing identity account mapping
@override
@ -205,16 +169,26 @@ class _$IdentityInstanceImpl extends _IdentityInstance {
@override
final FixedEncodedString86 signature;
/// Create a copy of IdentityInstance
/// with the given fields replaced by the non-null parameter values.
@override
String toString() {
return 'IdentityInstance(recordKey: $recordKey, publicKey: $publicKey, encryptedSecretKey: $encryptedSecretKey, superSignature: $superSignature, signature: $signature)';
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$IdentityInstanceCopyWith<_IdentityInstance> get copyWith =>
__$IdentityInstanceCopyWithImpl<_IdentityInstance>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$IdentityInstanceToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$IdentityInstanceImpl &&
other is _IdentityInstance &&
(identical(other.recordKey, recordKey) ||
other.recordKey == recordKey) &&
(identical(other.publicKey, publicKey) ||
@ -237,60 +211,70 @@ class _$IdentityInstanceImpl extends _IdentityInstance {
superSignature,
signature);
/// Create a copy of IdentityInstance
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$IdentityInstanceImplCopyWith<_$IdentityInstanceImpl> get copyWith =>
__$$IdentityInstanceImplCopyWithImpl<_$IdentityInstanceImpl>(
this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$IdentityInstanceImplToJson(
this,
);
String toString() {
return 'IdentityInstance(recordKey: $recordKey, publicKey: $publicKey, encryptedSecretKey: $encryptedSecretKey, superSignature: $superSignature, signature: $signature)';
}
}
abstract class _IdentityInstance extends IdentityInstance {
const factory _IdentityInstance(
{required final Typed<FixedEncodedString43> recordKey,
required final FixedEncodedString43 publicKey,
@Uint8ListJsonConverter() required final Uint8List encryptedSecretKey,
required final FixedEncodedString86 superSignature,
required final FixedEncodedString86 signature}) = _$IdentityInstanceImpl;
const _IdentityInstance._() : super._();
/// @nodoc
abstract mixin class _$IdentityInstanceCopyWith<$Res>
implements $IdentityInstanceCopyWith<$Res> {
factory _$IdentityInstanceCopyWith(
_IdentityInstance value, $Res Function(_IdentityInstance) _then) =
__$IdentityInstanceCopyWithImpl;
@override
@useResult
$Res call(
{Typed<FixedEncodedString43> recordKey,
FixedEncodedString43 publicKey,
@Uint8ListJsonConverter() Uint8List encryptedSecretKey,
FixedEncodedString86 superSignature,
FixedEncodedString86 signature});
}
factory _IdentityInstance.fromJson(Map<String, dynamic> json) =
_$IdentityInstanceImpl.fromJson;
/// @nodoc
class __$IdentityInstanceCopyWithImpl<$Res>
implements _$IdentityInstanceCopyWith<$Res> {
__$IdentityInstanceCopyWithImpl(this._self, this._then);
// Private DHT record storing identity account mapping
@override
Typed<FixedEncodedString43> get recordKey; // Public key of identity instance
@override
FixedEncodedString43 get publicKey; // Secret key of identity instance
// Encrypted with appended salt, key is DeriveSharedSecret(
// password = SuperIdentity.secret,
// salt = publicKey)
// Used to recover accounts without generating a new instance
@override
@Uint8ListJsonConverter()
Uint8List
get encryptedSecretKey; // Signature of SuperInstance recordKey and SuperInstance publicKey
// by publicKey
@override
FixedEncodedString86
get superSignature; // Signature of recordKey, publicKey, encryptedSecretKey, and superSignature
// by SuperIdentity publicKey
@override
FixedEncodedString86 get signature;
final _IdentityInstance _self;
final $Res Function(_IdentityInstance) _then;
/// Create a copy of IdentityInstance
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$IdentityInstanceImplCopyWith<_$IdentityInstanceImpl> get copyWith =>
throw _privateConstructorUsedError;
@pragma('vm:prefer-inline')
$Res call({
Object? recordKey = null,
Object? publicKey = null,
Object? encryptedSecretKey = null,
Object? superSignature = null,
Object? signature = null,
}) {
return _then(_IdentityInstance(
recordKey: null == recordKey
? _self.recordKey
: recordKey // ignore: cast_nullable_to_non_nullable
as Typed<FixedEncodedString43>,
publicKey: null == publicKey
? _self.publicKey
: publicKey // ignore: cast_nullable_to_non_nullable
as FixedEncodedString43,
encryptedSecretKey: null == encryptedSecretKey
? _self.encryptedSecretKey
: encryptedSecretKey // ignore: cast_nullable_to_non_nullable
as Uint8List,
superSignature: null == superSignature
? _self.superSignature
: superSignature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
signature: null == signature
? _self.signature
: signature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
));
}
}
// dart format on

View file

@ -6,9 +6,8 @@ part of 'identity_instance.dart';
// JsonSerializableGenerator
// **************************************************************************
_$IdentityInstanceImpl _$$IdentityInstanceImplFromJson(
Map<String, dynamic> json) =>
_$IdentityInstanceImpl(
_IdentityInstance _$IdentityInstanceFromJson(Map<String, dynamic> json) =>
_IdentityInstance(
recordKey: Typed<FixedEncodedString43>.fromJson(json['record_key']),
publicKey: FixedEncodedString43.fromJson(json['public_key']),
encryptedSecretKey:
@ -17,8 +16,7 @@ _$IdentityInstanceImpl _$$IdentityInstanceImplFromJson(
signature: FixedEncodedString86.fromJson(json['signature']),
);
Map<String, dynamic> _$$IdentityInstanceImplToJson(
_$IdentityInstanceImpl instance) =>
Map<String, dynamic> _$IdentityInstanceToJson(_IdentityInstance instance) =>
<String, dynamic>{
'record_key': instance.recordKey.toJson(),
'public_key': instance.publicKey.toJson(),

View file

@ -22,7 +22,7 @@ part 'super_identity.g.dart';
/// DHT Owner Secret: SuperIdentity Secret Key (kept offline)
/// Encryption: None
@freezed
class SuperIdentity with _$SuperIdentity {
sealed class SuperIdentity with _$SuperIdentity {
const factory SuperIdentity({
/// Public DHT record storing this structure for account recovery
/// changing this can migrate/forward the SuperIdentity to a new DHT record

View file

@ -1,3 +1,4 @@
// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@ -9,65 +10,93 @@ part of 'super_identity.dart';
// FreezedGenerator
// **************************************************************************
// dart format off
T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
SuperIdentity _$SuperIdentityFromJson(Map<String, dynamic> json) {
return _SuperIdentity.fromJson(json);
}
/// @nodoc
mixin _$SuperIdentity {
/// Public DHT record storing this structure for account recovery
/// changing this can migrate/forward the SuperIdentity to a new DHT record
/// Instances should not hash this recordKey, rather the actual record
/// key used to store the superIdentity, as this may change.
Typed<FixedEncodedString43> get recordKey =>
throw _privateConstructorUsedError;
TypedKey get recordKey;
/// Public key of the SuperIdentity used to sign identity keys for recovery
/// This must match the owner of the superRecord DHT record and can not be
/// changed without changing the record
FixedEncodedString43 get publicKey => throw _privateConstructorUsedError;
PublicKey get publicKey;
/// Current identity instance
/// The most recently generated identity instance for this SuperIdentity
IdentityInstance get currentInstance => throw _privateConstructorUsedError;
IdentityInstance get currentInstance;
/// Deprecated identity instances
/// These may be compromised and should not be considered valid for
/// new signatures, but may be used to validate old signatures
List<IdentityInstance> get deprecatedInstances =>
throw _privateConstructorUsedError;
List<IdentityInstance> get deprecatedInstances;
/// Deprecated superRecords
/// These may be compromised and should not be considered valid for
/// new signatures, but may be used to validate old signatures
List<Typed<FixedEncodedString43>> get deprecatedSuperRecordKeys =>
throw _privateConstructorUsedError;
List<TypedKey> get deprecatedSuperRecordKeys;
/// Signature of recordKey, currentInstance signature,
/// signatures of deprecatedInstances, and deprecatedSuperRecordKeys
/// by publicKey
FixedEncodedString86 get signature => throw _privateConstructorUsedError;
/// Serializes this SuperIdentity to a JSON map.
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
Signature get signature;
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
$SuperIdentityCopyWith<SuperIdentity> get copyWith =>
throw _privateConstructorUsedError;
_$SuperIdentityCopyWithImpl<SuperIdentity>(
this as SuperIdentity, _$identity);
/// Serializes this SuperIdentity to a JSON map.
Map<String, dynamic> toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is SuperIdentity &&
(identical(other.recordKey, recordKey) ||
other.recordKey == recordKey) &&
(identical(other.publicKey, publicKey) ||
other.publicKey == publicKey) &&
(identical(other.currentInstance, currentInstance) ||
other.currentInstance == currentInstance) &&
const DeepCollectionEquality()
.equals(other.deprecatedInstances, deprecatedInstances) &&
const DeepCollectionEquality().equals(
other.deprecatedSuperRecordKeys, deprecatedSuperRecordKeys) &&
(identical(other.signature, signature) ||
other.signature == signature));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(
runtimeType,
recordKey,
publicKey,
currentInstance,
const DeepCollectionEquality().hash(deprecatedInstances),
const DeepCollectionEquality().hash(deprecatedSuperRecordKeys),
signature);
@override
String toString() {
return 'SuperIdentity(recordKey: $recordKey, publicKey: $publicKey, currentInstance: $currentInstance, deprecatedInstances: $deprecatedInstances, deprecatedSuperRecordKeys: $deprecatedSuperRecordKeys, signature: $signature)';
}
}
/// @nodoc
abstract class $SuperIdentityCopyWith<$Res> {
abstract mixin class $SuperIdentityCopyWith<$Res> {
factory $SuperIdentityCopyWith(
SuperIdentity value, $Res Function(SuperIdentity) then) =
_$SuperIdentityCopyWithImpl<$Res, SuperIdentity>;
SuperIdentity value, $Res Function(SuperIdentity) _then) =
_$SuperIdentityCopyWithImpl;
@useResult
$Res call(
{Typed<FixedEncodedString43> recordKey,
@ -81,14 +110,12 @@ abstract class $SuperIdentityCopyWith<$Res> {
}
/// @nodoc
class _$SuperIdentityCopyWithImpl<$Res, $Val extends SuperIdentity>
class _$SuperIdentityCopyWithImpl<$Res>
implements $SuperIdentityCopyWith<$Res> {
_$SuperIdentityCopyWithImpl(this._value, this._then);
_$SuperIdentityCopyWithImpl(this._self, this._then);
// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;
final SuperIdentity _self;
final $Res Function(SuperIdentity) _then;
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@ -102,32 +129,32 @@ class _$SuperIdentityCopyWithImpl<$Res, $Val extends SuperIdentity>
Object? deprecatedSuperRecordKeys = null,
Object? signature = null,
}) {
return _then(_value.copyWith(
return _then(_self.copyWith(
recordKey: null == recordKey
? _value.recordKey
? _self.recordKey!
: recordKey // ignore: cast_nullable_to_non_nullable
as Typed<FixedEncodedString43>,
publicKey: null == publicKey
? _value.publicKey
? _self.publicKey!
: publicKey // ignore: cast_nullable_to_non_nullable
as FixedEncodedString43,
currentInstance: null == currentInstance
? _value.currentInstance
? _self.currentInstance
: currentInstance // ignore: cast_nullable_to_non_nullable
as IdentityInstance,
deprecatedInstances: null == deprecatedInstances
? _value.deprecatedInstances
? _self.deprecatedInstances
: deprecatedInstances // ignore: cast_nullable_to_non_nullable
as List<IdentityInstance>,
deprecatedSuperRecordKeys: null == deprecatedSuperRecordKeys
? _value.deprecatedSuperRecordKeys
? _self.deprecatedSuperRecordKeys!
: deprecatedSuperRecordKeys // ignore: cast_nullable_to_non_nullable
as List<Typed<FixedEncodedString43>>,
signature: null == signature
? _value.signature
? _self.signature!
: signature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
) as $Val);
));
}
/// Create a copy of SuperIdentity
@ -135,85 +162,16 @@ class _$SuperIdentityCopyWithImpl<$Res, $Val extends SuperIdentity>
@override
@pragma('vm:prefer-inline')
$IdentityInstanceCopyWith<$Res> get currentInstance {
return $IdentityInstanceCopyWith<$Res>(_value.currentInstance, (value) {
return _then(_value.copyWith(currentInstance: value) as $Val);
return $IdentityInstanceCopyWith<$Res>(_self.currentInstance, (value) {
return _then(_self.copyWith(currentInstance: value));
});
}
}
/// @nodoc
abstract class _$$SuperIdentityImplCopyWith<$Res>
implements $SuperIdentityCopyWith<$Res> {
factory _$$SuperIdentityImplCopyWith(
_$SuperIdentityImpl value, $Res Function(_$SuperIdentityImpl) then) =
__$$SuperIdentityImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{Typed<FixedEncodedString43> recordKey,
FixedEncodedString43 publicKey,
IdentityInstance currentInstance,
List<IdentityInstance> deprecatedInstances,
List<Typed<FixedEncodedString43>> deprecatedSuperRecordKeys,
FixedEncodedString86 signature});
@override
$IdentityInstanceCopyWith<$Res> get currentInstance;
}
/// @nodoc
class __$$SuperIdentityImplCopyWithImpl<$Res>
extends _$SuperIdentityCopyWithImpl<$Res, _$SuperIdentityImpl>
implements _$$SuperIdentityImplCopyWith<$Res> {
__$$SuperIdentityImplCopyWithImpl(
_$SuperIdentityImpl _value, $Res Function(_$SuperIdentityImpl) _then)
: super(_value, _then);
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
@override
$Res call({
Object? recordKey = null,
Object? publicKey = null,
Object? currentInstance = null,
Object? deprecatedInstances = null,
Object? deprecatedSuperRecordKeys = null,
Object? signature = null,
}) {
return _then(_$SuperIdentityImpl(
recordKey: null == recordKey
? _value.recordKey
: recordKey // ignore: cast_nullable_to_non_nullable
as Typed<FixedEncodedString43>,
publicKey: null == publicKey
? _value.publicKey
: publicKey // ignore: cast_nullable_to_non_nullable
as FixedEncodedString43,
currentInstance: null == currentInstance
? _value.currentInstance
: currentInstance // ignore: cast_nullable_to_non_nullable
as IdentityInstance,
deprecatedInstances: null == deprecatedInstances
? _value._deprecatedInstances
: deprecatedInstances // ignore: cast_nullable_to_non_nullable
as List<IdentityInstance>,
deprecatedSuperRecordKeys: null == deprecatedSuperRecordKeys
? _value._deprecatedSuperRecordKeys
: deprecatedSuperRecordKeys // ignore: cast_nullable_to_non_nullable
as List<Typed<FixedEncodedString43>>,
signature: null == signature
? _value.signature
: signature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
));
}
}
/// @nodoc
@JsonSerializable()
class _$SuperIdentityImpl extends _SuperIdentity {
const _$SuperIdentityImpl(
class _SuperIdentity extends SuperIdentity {
const _SuperIdentity(
{required this.recordKey,
required this.publicKey,
required this.currentInstance,
@ -224,9 +182,8 @@ class _$SuperIdentityImpl extends _SuperIdentity {
: _deprecatedInstances = deprecatedInstances,
_deprecatedSuperRecordKeys = deprecatedSuperRecordKeys,
super._();
factory _$SuperIdentityImpl.fromJson(Map<String, dynamic> json) =>
_$$SuperIdentityImplFromJson(json);
factory _SuperIdentity.fromJson(Map<String, dynamic> json) =>
_$SuperIdentityFromJson(json);
/// Public DHT record storing this structure for account recovery
/// changing this can migrate/forward the SuperIdentity to a new DHT record
@ -284,16 +241,26 @@ class _$SuperIdentityImpl extends _SuperIdentity {
@override
final FixedEncodedString86 signature;
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@override
String toString() {
return 'SuperIdentity(recordKey: $recordKey, publicKey: $publicKey, currentInstance: $currentInstance, deprecatedInstances: $deprecatedInstances, deprecatedSuperRecordKeys: $deprecatedSuperRecordKeys, signature: $signature)';
@JsonKey(includeFromJson: false, includeToJson: false)
@pragma('vm:prefer-inline')
_$SuperIdentityCopyWith<_SuperIdentity> get copyWith =>
__$SuperIdentityCopyWithImpl<_SuperIdentity>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$SuperIdentityToJson(
this,
);
}
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$SuperIdentityImpl &&
other is _SuperIdentity &&
(identical(other.recordKey, recordKey) ||
other.recordKey == recordKey) &&
(identical(other.publicKey, publicKey) ||
@ -319,76 +286,89 @@ class _$SuperIdentityImpl extends _SuperIdentity {
const DeepCollectionEquality().hash(_deprecatedSuperRecordKeys),
signature);
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
_$$SuperIdentityImplCopyWith<_$SuperIdentityImpl> get copyWith =>
__$$SuperIdentityImplCopyWithImpl<_$SuperIdentityImpl>(this, _$identity);
@override
Map<String, dynamic> toJson() {
return _$$SuperIdentityImplToJson(
this,
);
String toString() {
return 'SuperIdentity(recordKey: $recordKey, publicKey: $publicKey, currentInstance: $currentInstance, deprecatedInstances: $deprecatedInstances, deprecatedSuperRecordKeys: $deprecatedSuperRecordKeys, signature: $signature)';
}
}
abstract class _SuperIdentity extends SuperIdentity {
const factory _SuperIdentity(
{required final Typed<FixedEncodedString43> recordKey,
required final FixedEncodedString43 publicKey,
required final IdentityInstance currentInstance,
required final List<IdentityInstance> deprecatedInstances,
required final List<Typed<FixedEncodedString43>>
deprecatedSuperRecordKeys,
required final FixedEncodedString86 signature}) = _$SuperIdentityImpl;
const _SuperIdentity._() : super._();
factory _SuperIdentity.fromJson(Map<String, dynamic> json) =
_$SuperIdentityImpl.fromJson;
/// Public DHT record storing this structure for account recovery
/// changing this can migrate/forward the SuperIdentity to a new DHT record
/// Instances should not hash this recordKey, rather the actual record
/// key used to store the superIdentity, as this may change.
/// @nodoc
abstract mixin class _$SuperIdentityCopyWith<$Res>
implements $SuperIdentityCopyWith<$Res> {
factory _$SuperIdentityCopyWith(
_SuperIdentity value, $Res Function(_SuperIdentity) _then) =
__$SuperIdentityCopyWithImpl;
@override
Typed<FixedEncodedString43> get recordKey;
@useResult
$Res call(
{Typed<FixedEncodedString43> recordKey,
FixedEncodedString43 publicKey,
IdentityInstance currentInstance,
List<IdentityInstance> deprecatedInstances,
List<Typed<FixedEncodedString43>> deprecatedSuperRecordKeys,
FixedEncodedString86 signature});
/// Public key of the SuperIdentity used to sign identity keys for recovery
/// This must match the owner of the superRecord DHT record and can not be
/// changed without changing the record
@override
FixedEncodedString43 get publicKey;
$IdentityInstanceCopyWith<$Res> get currentInstance;
}
/// Current identity instance
/// The most recently generated identity instance for this SuperIdentity
@override
IdentityInstance get currentInstance;
/// @nodoc
class __$SuperIdentityCopyWithImpl<$Res>
implements _$SuperIdentityCopyWith<$Res> {
__$SuperIdentityCopyWithImpl(this._self, this._then);
/// Deprecated identity instances
/// These may be compromised and should not be considered valid for
/// new signatures, but may be used to validate old signatures
@override
List<IdentityInstance> get deprecatedInstances;
/// Deprecated superRecords
/// These may be compromised and should not be considered valid for
/// new signatures, but may be used to validate old signatures
@override
List<Typed<FixedEncodedString43>> get deprecatedSuperRecordKeys;
/// Signature of recordKey, currentInstance signature,
/// signatures of deprecatedInstances, and deprecatedSuperRecordKeys
/// by publicKey
@override
FixedEncodedString86 get signature;
final _SuperIdentity _self;
final $Res Function(_SuperIdentity) _then;
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
_$$SuperIdentityImplCopyWith<_$SuperIdentityImpl> get copyWith =>
throw _privateConstructorUsedError;
@pragma('vm:prefer-inline')
$Res call({
Object? recordKey = null,
Object? publicKey = null,
Object? currentInstance = null,
Object? deprecatedInstances = null,
Object? deprecatedSuperRecordKeys = null,
Object? signature = null,
}) {
return _then(_SuperIdentity(
recordKey: null == recordKey
? _self.recordKey
: recordKey // ignore: cast_nullable_to_non_nullable
as Typed<FixedEncodedString43>,
publicKey: null == publicKey
? _self.publicKey
: publicKey // ignore: cast_nullable_to_non_nullable
as FixedEncodedString43,
currentInstance: null == currentInstance
? _self.currentInstance
: currentInstance // ignore: cast_nullable_to_non_nullable
as IdentityInstance,
deprecatedInstances: null == deprecatedInstances
? _self._deprecatedInstances
: deprecatedInstances // ignore: cast_nullable_to_non_nullable
as List<IdentityInstance>,
deprecatedSuperRecordKeys: null == deprecatedSuperRecordKeys
? _self._deprecatedSuperRecordKeys
: deprecatedSuperRecordKeys // ignore: cast_nullable_to_non_nullable
as List<Typed<FixedEncodedString43>>,
signature: null == signature
? _self.signature
: signature // ignore: cast_nullable_to_non_nullable
as FixedEncodedString86,
));
}
/// Create a copy of SuperIdentity
/// with the given fields replaced by the non-null parameter values.
@override
@pragma('vm:prefer-inline')
$IdentityInstanceCopyWith<$Res> get currentInstance {
return $IdentityInstanceCopyWith<$Res>(_self.currentInstance, (value) {
return _then(_self.copyWith(currentInstance: value));
});
}
}
// dart format on

View file

@ -6,8 +6,8 @@ part of 'super_identity.dart';
// JsonSerializableGenerator
// **************************************************************************
_$SuperIdentityImpl _$$SuperIdentityImplFromJson(Map<String, dynamic> json) =>
_$SuperIdentityImpl(
_SuperIdentity _$SuperIdentityFromJson(Map<String, dynamic> json) =>
_SuperIdentity(
recordKey: Typed<FixedEncodedString43>.fromJson(json['record_key']),
publicKey: FixedEncodedString43.fromJson(json['public_key']),
currentInstance: IdentityInstance.fromJson(json['current_instance']),
@ -21,7 +21,7 @@ _$SuperIdentityImpl _$$SuperIdentityImplFromJson(Map<String, dynamic> json) =>
signature: FixedEncodedString86.fromJson(json['signature']),
);
Map<String, dynamic> _$$SuperIdentityImplToJson(_$SuperIdentityImpl instance) =>
Map<String, dynamic> _$SuperIdentityToJson(_SuperIdentity instance) =>
<String, dynamic>{
'record_key': instance.recordKey.toJson(),
'public_key': instance.publicKey.toJson(),