Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • DanBaDo/ginkgo
  • flodef/ginkgo
  • zicmama/ginkgo
  • vjrj/ginkgo
  • pokapow/ginkgo
  • weblate/ginkgo
6 results
Show changes
Showing
with 2220 additions and 0 deletions
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef PalletId = List<int>;
class PalletIdCodec with _i1.Codec<PalletId> {
const PalletIdCodec();
@override
PalletId decode(_i1.Input input) {
return const _i1.U8ArrayCodec(8).decode(input);
}
@override
void encodeTo(
PalletId value,
_i1.Output output,
) {
const _i1.U8ArrayCodec(8).encodeTo(
value,
output,
);
}
@override
int sizeHint(PalletId value) {
return const _i1.U8ArrayCodec(8).sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i2;
import 'package:polkadart/scale_codec.dart' as _i1;
import 'package:quiver/collection.dart' as _i4;
import '../../../primitive_types/h256.dart' as _i3;
abstract class Bounded {
const Bounded();
factory Bounded.decode(_i1.Input input) {
return codec.decode(input);
}
static const $BoundedCodec codec = $BoundedCodec();
static const $Bounded values = $Bounded();
_i2.Uint8List encode() {
final output = _i1.ByteOutput(codec.sizeHint(this));
codec.encodeTo(this, output);
return output.toBytes();
}
int sizeHint() {
return codec.sizeHint(this);
}
Map<String, dynamic> toJson();
}
class $Bounded {
const $Bounded();
Legacy legacy({required _i3.H256 hash}) {
return Legacy(hash: hash);
}
Inline inline(List<int> value0) {
return Inline(value0);
}
Lookup lookup({
required _i3.H256 hash,
required int len,
}) {
return Lookup(
hash: hash,
len: len,
);
}
}
class $BoundedCodec with _i1.Codec<Bounded> {
const $BoundedCodec();
@override
Bounded decode(_i1.Input input) {
final index = _i1.U8Codec.codec.decode(input);
switch (index) {
case 0:
return Legacy._decode(input);
case 1:
return Inline._decode(input);
case 2:
return Lookup._decode(input);
default:
throw Exception('Bounded: Invalid variant index: "$index"');
}
}
@override
void encodeTo(
Bounded value,
_i1.Output output,
) {
switch (value.runtimeType) {
case Legacy:
(value as Legacy).encodeTo(output);
break;
case Inline:
(value as Inline).encodeTo(output);
break;
case Lookup:
(value as Lookup).encodeTo(output);
break;
default:
throw Exception(
'Bounded: Unsupported "$value" of type "${value.runtimeType}"');
}
}
@override
int sizeHint(Bounded value) {
switch (value.runtimeType) {
case Legacy:
return (value as Legacy)._sizeHint();
case Inline:
return (value as Inline)._sizeHint();
case Lookup:
return (value as Lookup)._sizeHint();
default:
throw Exception(
'Bounded: Unsupported "$value" of type "${value.runtimeType}"');
}
}
}
class Legacy extends Bounded {
const Legacy({required this.hash});
factory Legacy._decode(_i1.Input input) {
return Legacy(hash: const _i1.U8ArrayCodec(32).decode(input));
}
/// H::Output
final _i3.H256 hash;
@override
Map<String, Map<String, List<int>>> toJson() => {
'Legacy': {'hash': hash.toList()}
};
int _sizeHint() {
int size = 1;
size = size + const _i3.H256Codec().sizeHint(hash);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
0,
output,
);
const _i1.U8ArrayCodec(32).encodeTo(
hash,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is Legacy &&
_i4.listsEqual(
other.hash,
hash,
);
@override
int get hashCode => hash.hashCode;
}
class Inline extends Bounded {
const Inline(this.value0);
factory Inline._decode(_i1.Input input) {
return Inline(_i1.U8SequenceCodec.codec.decode(input));
}
/// BoundedInline
final List<int> value0;
@override
Map<String, List<int>> toJson() => {'Inline': value0};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(value0);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
1,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
value0,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is Inline &&
_i4.listsEqual(
other.value0,
value0,
);
@override
int get hashCode => value0.hashCode;
}
class Lookup extends Bounded {
const Lookup({
required this.hash,
required this.len,
});
factory Lookup._decode(_i1.Input input) {
return Lookup(
hash: const _i1.U8ArrayCodec(32).decode(input),
len: _i1.U32Codec.codec.decode(input),
);
}
/// H::Output
final _i3.H256 hash;
/// u32
final int len;
@override
Map<String, Map<String, dynamic>> toJson() => {
'Lookup': {
'hash': hash.toList(),
'len': len,
}
};
int _sizeHint() {
int size = 1;
size = size + const _i3.H256Codec().sizeHint(hash);
size = size + _i1.U32Codec.codec.sizeHint(len);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
2,
output,
);
const _i1.U8ArrayCodec(32).encodeTo(
hash,
output,
);
_i1.U32Codec.codec.encodeTo(
len,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is Lookup &&
_i4.listsEqual(
other.hash,
hash,
) &&
other.len == len;
@override
int get hashCode => Object.hash(
hash,
len,
);
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i2;
import 'package:polkadart/scale_codec.dart' as _i1;
enum BalanceStatus {
free('Free', 0),
reserved('Reserved', 1);
const BalanceStatus(
this.variantName,
this.codecIndex,
);
factory BalanceStatus.decode(_i1.Input input) {
return codec.decode(input);
}
final String variantName;
final int codecIndex;
static const $BalanceStatusCodec codec = $BalanceStatusCodec();
String toJson() => variantName;
_i2.Uint8List encode() {
return codec.encode(this);
}
}
class $BalanceStatusCodec with _i1.Codec<BalanceStatus> {
const $BalanceStatusCodec();
@override
BalanceStatus decode(_i1.Input input) {
final index = _i1.U8Codec.codec.decode(input);
switch (index) {
case 0:
return BalanceStatus.free;
case 1:
return BalanceStatus.reserved;
default:
throw Exception('BalanceStatus: Invalid variant index: "$index"');
}
}
@override
void encodeTo(
BalanceStatus value,
_i1.Output output,
) {
_i1.U8Codec.codec.encodeTo(
value.codecIndex,
output,
);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i3;
import 'package:polkadart/scale_codec.dart' as _i1;
import '../../../../gdev_runtime/runtime_hold_reason.dart' as _i2;
class IdAmount {
const IdAmount({
required this.id,
required this.amount,
});
factory IdAmount.decode(_i1.Input input) {
return codec.decode(input);
}
/// Id
final _i2.RuntimeHoldReason id;
/// Balance
final BigInt amount;
static const $IdAmountCodec codec = $IdAmountCodec();
_i3.Uint8List encode() {
return codec.encode(this);
}
Map<String, dynamic> toJson() => {
'id': id.toJson(),
'amount': amount,
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is IdAmount && other.id == id && other.amount == amount;
@override
int get hashCode => Object.hash(
id,
amount,
);
}
class $IdAmountCodec with _i1.Codec<IdAmount> {
const $IdAmountCodec();
@override
void encodeTo(
IdAmount obj,
_i1.Output output,
) {
_i2.RuntimeHoldReason.codec.encodeTo(
obj.id,
output,
);
_i1.U64Codec.codec.encodeTo(
obj.amount,
output,
);
}
@override
IdAmount decode(_i1.Input input) {
return IdAmount(
id: _i2.RuntimeHoldReason.codec.decode(input),
amount: _i1.U64Codec.codec.decode(input),
);
}
@override
int sizeHint(IdAmount obj) {
int size = 0;
size = size + _i2.RuntimeHoldReason.codec.sizeHint(obj.id);
size = size + _i1.U64Codec.codec.sizeHint(obj.amount);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i2;
import 'package:polkadart/scale_codec.dart' as _i1;
class IdAmount {
const IdAmount({
required this.id,
required this.amount,
});
factory IdAmount.decode(_i1.Input input) {
return codec.decode(input);
}
/// Id
final dynamic id;
/// Balance
final BigInt amount;
static const $IdAmountCodec codec = $IdAmountCodec();
_i2.Uint8List encode() {
return codec.encode(this);
}
Map<String, dynamic> toJson() => {
'id': null,
'amount': amount,
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is IdAmount && other.id == id && other.amount == amount;
@override
int get hashCode => Object.hash(
id,
amount,
);
}
class $IdAmountCodec with _i1.Codec<IdAmount> {
const $IdAmountCodec();
@override
void encodeTo(
IdAmount obj,
_i1.Output output,
) {
_i1.NullCodec.codec.encodeTo(
obj.id,
output,
);
_i1.U64Codec.codec.encodeTo(
obj.amount,
output,
);
}
@override
IdAmount decode(_i1.Input input) {
return IdAmount(
id: _i1.NullCodec.codec.decode(input),
amount: _i1.U64Codec.codec.decode(input),
);
}
@override
int sizeHint(IdAmount obj) {
int size = 0;
size = size + _i1.NullCodec.codec.sizeHint(obj.id);
size = size + _i1.U64Codec.codec.sizeHint(obj.amount);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i3;
import 'package:polkadart/scale_codec.dart' as _i1;
import '../pallet_duniter_account/types/account_data.dart' as _i2;
class AccountInfo {
const AccountInfo({
required this.nonce,
required this.consumers,
required this.providers,
required this.sufficients,
required this.data,
});
factory AccountInfo.decode(_i1.Input input) {
return codec.decode(input);
}
/// Nonce
final int nonce;
/// RefCount
final int consumers;
/// RefCount
final int providers;
/// RefCount
final int sufficients;
/// AccountData
final _i2.AccountData data;
static const $AccountInfoCodec codec = $AccountInfoCodec();
_i3.Uint8List encode() {
return codec.encode(this);
}
Map<String, dynamic> toJson() => {
'nonce': nonce,
'consumers': consumers,
'providers': providers,
'sufficients': sufficients,
'data': data.toJson(),
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is AccountInfo &&
other.nonce == nonce &&
other.consumers == consumers &&
other.providers == providers &&
other.sufficients == sufficients &&
other.data == data;
@override
int get hashCode => Object.hash(
nonce,
consumers,
providers,
sufficients,
data,
);
}
class $AccountInfoCodec with _i1.Codec<AccountInfo> {
const $AccountInfoCodec();
@override
void encodeTo(
AccountInfo obj,
_i1.Output output,
) {
_i1.U32Codec.codec.encodeTo(
obj.nonce,
output,
);
_i1.U32Codec.codec.encodeTo(
obj.consumers,
output,
);
_i1.U32Codec.codec.encodeTo(
obj.providers,
output,
);
_i1.U32Codec.codec.encodeTo(
obj.sufficients,
output,
);
_i2.AccountData.codec.encodeTo(
obj.data,
output,
);
}
@override
AccountInfo decode(_i1.Input input) {
return AccountInfo(
nonce: _i1.U32Codec.codec.decode(input),
consumers: _i1.U32Codec.codec.decode(input),
providers: _i1.U32Codec.codec.decode(input),
sufficients: _i1.U32Codec.codec.decode(input),
data: _i2.AccountData.codec.decode(input),
);
}
@override
int sizeHint(AccountInfo obj) {
int size = 0;
size = size + _i1.U32Codec.codec.sizeHint(obj.nonce);
size = size + _i1.U32Codec.codec.sizeHint(obj.consumers);
size = size + _i1.U32Codec.codec.sizeHint(obj.providers);
size = size + _i1.U32Codec.codec.sizeHint(obj.sufficients);
size = size + _i2.AccountData.codec.sizeHint(obj.data);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i3;
import 'package:polkadart/scale_codec.dart' as _i1;
import 'package:quiver/collection.dart' as _i4;
import '../primitive_types/h256.dart' as _i2;
class CodeUpgradeAuthorization {
const CodeUpgradeAuthorization({
required this.codeHash,
required this.checkVersion,
});
factory CodeUpgradeAuthorization.decode(_i1.Input input) {
return codec.decode(input);
}
/// T::Hash
final _i2.H256 codeHash;
/// bool
final bool checkVersion;
static const $CodeUpgradeAuthorizationCodec codec =
$CodeUpgradeAuthorizationCodec();
_i3.Uint8List encode() {
return codec.encode(this);
}
Map<String, dynamic> toJson() => {
'codeHash': codeHash.toList(),
'checkVersion': checkVersion,
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is CodeUpgradeAuthorization &&
_i4.listsEqual(
other.codeHash,
codeHash,
) &&
other.checkVersion == checkVersion;
@override
int get hashCode => Object.hash(
codeHash,
checkVersion,
);
}
class $CodeUpgradeAuthorizationCodec with _i1.Codec<CodeUpgradeAuthorization> {
const $CodeUpgradeAuthorizationCodec();
@override
void encodeTo(
CodeUpgradeAuthorization obj,
_i1.Output output,
) {
const _i1.U8ArrayCodec(32).encodeTo(
obj.codeHash,
output,
);
_i1.BoolCodec.codec.encodeTo(
obj.checkVersion,
output,
);
}
@override
CodeUpgradeAuthorization decode(_i1.Input input) {
return CodeUpgradeAuthorization(
codeHash: const _i1.U8ArrayCodec(32).decode(input),
checkVersion: _i1.BoolCodec.codec.decode(input),
);
}
@override
int sizeHint(CodeUpgradeAuthorization obj) {
int size = 0;
size = size + const _i2.H256Codec().sizeHint(obj.codeHash);
size = size + _i1.BoolCodec.codec.sizeHint(obj.checkVersion);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i5;
import 'package:polkadart/scale_codec.dart' as _i1;
import 'package:quiver/collection.dart' as _i6;
import '../gdev_runtime/runtime_event.dart' as _i3;
import '../primitive_types/h256.dart' as _i4;
import 'phase.dart' as _i2;
class EventRecord {
const EventRecord({
required this.phase,
required this.event,
required this.topics,
});
factory EventRecord.decode(_i1.Input input) {
return codec.decode(input);
}
/// Phase
final _i2.Phase phase;
/// E
final _i3.RuntimeEvent event;
/// Vec<T>
final List<_i4.H256> topics;
static const $EventRecordCodec codec = $EventRecordCodec();
_i5.Uint8List encode() {
return codec.encode(this);
}
Map<String, dynamic> toJson() => {
'phase': phase.toJson(),
'event': event.toJson(),
'topics': topics.map((value) => value.toList()).toList(),
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is EventRecord &&
other.phase == phase &&
other.event == event &&
_i6.listsEqual(
other.topics,
topics,
);
@override
int get hashCode => Object.hash(
phase,
event,
topics,
);
}
class $EventRecordCodec with _i1.Codec<EventRecord> {
const $EventRecordCodec();
@override
void encodeTo(
EventRecord obj,
_i1.Output output,
) {
_i2.Phase.codec.encodeTo(
obj.phase,
output,
);
_i3.RuntimeEvent.codec.encodeTo(
obj.event,
output,
);
const _i1.SequenceCodec<_i4.H256>(_i4.H256Codec()).encodeTo(
obj.topics,
output,
);
}
@override
EventRecord decode(_i1.Input input) {
return EventRecord(
phase: _i2.Phase.codec.decode(input),
event: _i3.RuntimeEvent.codec.decode(input),
topics: const _i1.SequenceCodec<_i4.H256>(_i4.H256Codec()).decode(input),
);
}
@override
int sizeHint(EventRecord obj) {
int size = 0;
size = size + _i2.Phase.codec.sizeHint(obj.phase);
size = size + _i3.RuntimeEvent.codec.sizeHint(obj.event);
size = size +
const _i1.SequenceCodec<_i4.H256>(_i4.H256Codec()).sizeHint(obj.topics);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef CheckGenesis = dynamic;
class CheckGenesisCodec with _i1.Codec<CheckGenesis> {
const CheckGenesisCodec();
@override
CheckGenesis decode(_i1.Input input) {
return _i1.NullCodec.codec.decode(input);
}
@override
void encodeTo(
CheckGenesis value,
_i1.Output output,
) {
_i1.NullCodec.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckGenesis value) {
return _i1.NullCodec.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i2;
import '../../../sp_runtime/generic/era/era.dart' as _i1;
typedef CheckMortality = _i1.Era;
class CheckMortalityCodec with _i2.Codec<CheckMortality> {
const CheckMortalityCodec();
@override
CheckMortality decode(_i2.Input input) {
return _i1.Era.codec.decode(input);
}
@override
void encodeTo(
CheckMortality value,
_i2.Output output,
) {
_i1.Era.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckMortality value) {
return _i1.Era.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef CheckNonZeroSender = dynamic;
class CheckNonZeroSenderCodec with _i1.Codec<CheckNonZeroSender> {
const CheckNonZeroSenderCodec();
@override
CheckNonZeroSender decode(_i1.Input input) {
return _i1.NullCodec.codec.decode(input);
}
@override
void encodeTo(
CheckNonZeroSender value,
_i1.Output output,
) {
_i1.NullCodec.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckNonZeroSender value) {
return _i1.NullCodec.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef CheckNonce = BigInt;
class CheckNonceCodec with _i1.Codec<CheckNonce> {
const CheckNonceCodec();
@override
CheckNonce decode(_i1.Input input) {
return _i1.CompactBigIntCodec.codec.decode(input);
}
@override
void encodeTo(
CheckNonce value,
_i1.Output output,
) {
_i1.CompactBigIntCodec.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckNonce value) {
return _i1.CompactBigIntCodec.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef CheckSpecVersion = dynamic;
class CheckSpecVersionCodec with _i1.Codec<CheckSpecVersion> {
const CheckSpecVersionCodec();
@override
CheckSpecVersion decode(_i1.Input input) {
return _i1.NullCodec.codec.decode(input);
}
@override
void encodeTo(
CheckSpecVersion value,
_i1.Output output,
) {
_i1.NullCodec.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckSpecVersion value) {
return _i1.NullCodec.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef CheckTxVersion = dynamic;
class CheckTxVersionCodec with _i1.Codec<CheckTxVersion> {
const CheckTxVersionCodec();
@override
CheckTxVersion decode(_i1.Input input) {
return _i1.NullCodec.codec.decode(input);
}
@override
void encodeTo(
CheckTxVersion value,
_i1.Output output,
) {
_i1.NullCodec.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckTxVersion value) {
return _i1.NullCodec.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:polkadart/scale_codec.dart' as _i1;
typedef CheckWeight = dynamic;
class CheckWeightCodec with _i1.Codec<CheckWeight> {
const CheckWeightCodec();
@override
CheckWeight decode(_i1.Input input) {
return _i1.NullCodec.codec.decode(input);
}
@override
void encodeTo(
CheckWeight value,
_i1.Output output,
) {
_i1.NullCodec.codec.encodeTo(
value,
output,
);
}
@override
int sizeHint(CheckWeight value) {
return _i1.NullCodec.codec.sizeHint(value);
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i2;
import 'package:polkadart/scale_codec.dart' as _i1;
class LastRuntimeUpgradeInfo {
const LastRuntimeUpgradeInfo({
required this.specVersion,
required this.specName,
});
factory LastRuntimeUpgradeInfo.decode(_i1.Input input) {
return codec.decode(input);
}
/// codec::Compact<u32>
final BigInt specVersion;
/// sp_runtime::RuntimeString
final String specName;
static const $LastRuntimeUpgradeInfoCodec codec =
$LastRuntimeUpgradeInfoCodec();
_i2.Uint8List encode() {
return codec.encode(this);
}
Map<String, dynamic> toJson() => {
'specVersion': specVersion,
'specName': specName,
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is LastRuntimeUpgradeInfo &&
other.specVersion == specVersion &&
other.specName == specName;
@override
int get hashCode => Object.hash(
specVersion,
specName,
);
}
class $LastRuntimeUpgradeInfoCodec with _i1.Codec<LastRuntimeUpgradeInfo> {
const $LastRuntimeUpgradeInfoCodec();
@override
void encodeTo(
LastRuntimeUpgradeInfo obj,
_i1.Output output,
) {
_i1.CompactBigIntCodec.codec.encodeTo(
obj.specVersion,
output,
);
_i1.StrCodec.codec.encodeTo(
obj.specName,
output,
);
}
@override
LastRuntimeUpgradeInfo decode(_i1.Input input) {
return LastRuntimeUpgradeInfo(
specVersion: _i1.CompactBigIntCodec.codec.decode(input),
specName: _i1.StrCodec.codec.decode(input),
);
}
@override
int sizeHint(LastRuntimeUpgradeInfo obj) {
int size = 0;
size = size + _i1.CompactBigIntCodec.codec.sizeHint(obj.specVersion);
size = size + _i1.StrCodec.codec.sizeHint(obj.specName);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i3;
import 'package:polkadart/scale_codec.dart' as _i1;
import '../../frame_support/dispatch/per_dispatch_class_3.dart' as _i2;
class BlockLength {
const BlockLength({required this.max});
factory BlockLength.decode(_i1.Input input) {
return codec.decode(input);
}
/// PerDispatchClass<u32>
final _i2.PerDispatchClass max;
static const $BlockLengthCodec codec = $BlockLengthCodec();
_i3.Uint8List encode() {
return codec.encode(this);
}
Map<String, Map<String, int>> toJson() => {'max': max.toJson()};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is BlockLength && other.max == max;
@override
int get hashCode => max.hashCode;
}
class $BlockLengthCodec with _i1.Codec<BlockLength> {
const $BlockLengthCodec();
@override
void encodeTo(
BlockLength obj,
_i1.Output output,
) {
_i2.PerDispatchClass.codec.encodeTo(
obj.max,
output,
);
}
@override
BlockLength decode(_i1.Input input) {
return BlockLength(max: _i2.PerDispatchClass.codec.decode(input));
}
@override
int sizeHint(BlockLength obj) {
int size = 0;
size = size + _i2.PerDispatchClass.codec.sizeHint(obj.max);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i4;
import 'package:polkadart/scale_codec.dart' as _i1;
import '../../frame_support/dispatch/per_dispatch_class_2.dart' as _i3;
import '../../sp_weights/weight_v2/weight.dart' as _i2;
class BlockWeights {
const BlockWeights({
required this.baseBlock,
required this.maxBlock,
required this.perClass,
});
factory BlockWeights.decode(_i1.Input input) {
return codec.decode(input);
}
/// Weight
final _i2.Weight baseBlock;
/// Weight
final _i2.Weight maxBlock;
/// PerDispatchClass<WeightsPerClass>
final _i3.PerDispatchClass perClass;
static const $BlockWeightsCodec codec = $BlockWeightsCodec();
_i4.Uint8List encode() {
return codec.encode(this);
}
Map<String, Map<String, dynamic>> toJson() => {
'baseBlock': baseBlock.toJson(),
'maxBlock': maxBlock.toJson(),
'perClass': perClass.toJson(),
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is BlockWeights &&
other.baseBlock == baseBlock &&
other.maxBlock == maxBlock &&
other.perClass == perClass;
@override
int get hashCode => Object.hash(
baseBlock,
maxBlock,
perClass,
);
}
class $BlockWeightsCodec with _i1.Codec<BlockWeights> {
const $BlockWeightsCodec();
@override
void encodeTo(
BlockWeights obj,
_i1.Output output,
) {
_i2.Weight.codec.encodeTo(
obj.baseBlock,
output,
);
_i2.Weight.codec.encodeTo(
obj.maxBlock,
output,
);
_i3.PerDispatchClass.codec.encodeTo(
obj.perClass,
output,
);
}
@override
BlockWeights decode(_i1.Input input) {
return BlockWeights(
baseBlock: _i2.Weight.codec.decode(input),
maxBlock: _i2.Weight.codec.decode(input),
perClass: _i3.PerDispatchClass.codec.decode(input),
);
}
@override
int sizeHint(BlockWeights obj) {
int size = 0;
size = size + _i2.Weight.codec.sizeHint(obj.baseBlock);
size = size + _i2.Weight.codec.sizeHint(obj.maxBlock);
size = size + _i3.PerDispatchClass.codec.sizeHint(obj.perClass);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i3;
import 'package:polkadart/scale_codec.dart' as _i1;
import '../../sp_weights/weight_v2/weight.dart' as _i2;
class WeightsPerClass {
const WeightsPerClass({
required this.baseExtrinsic,
this.maxExtrinsic,
this.maxTotal,
this.reserved,
});
factory WeightsPerClass.decode(_i1.Input input) {
return codec.decode(input);
}
/// Weight
final _i2.Weight baseExtrinsic;
/// Option<Weight>
final _i2.Weight? maxExtrinsic;
/// Option<Weight>
final _i2.Weight? maxTotal;
/// Option<Weight>
final _i2.Weight? reserved;
static const $WeightsPerClassCodec codec = $WeightsPerClassCodec();
_i3.Uint8List encode() {
return codec.encode(this);
}
Map<String, Map<String, BigInt>?> toJson() => {
'baseExtrinsic': baseExtrinsic.toJson(),
'maxExtrinsic': maxExtrinsic?.toJson(),
'maxTotal': maxTotal?.toJson(),
'reserved': reserved?.toJson(),
};
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is WeightsPerClass &&
other.baseExtrinsic == baseExtrinsic &&
other.maxExtrinsic == maxExtrinsic &&
other.maxTotal == maxTotal &&
other.reserved == reserved;
@override
int get hashCode => Object.hash(
baseExtrinsic,
maxExtrinsic,
maxTotal,
reserved,
);
}
class $WeightsPerClassCodec with _i1.Codec<WeightsPerClass> {
const $WeightsPerClassCodec();
@override
void encodeTo(
WeightsPerClass obj,
_i1.Output output,
) {
_i2.Weight.codec.encodeTo(
obj.baseExtrinsic,
output,
);
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec).encodeTo(
obj.maxExtrinsic,
output,
);
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec).encodeTo(
obj.maxTotal,
output,
);
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec).encodeTo(
obj.reserved,
output,
);
}
@override
WeightsPerClass decode(_i1.Input input) {
return WeightsPerClass(
baseExtrinsic: _i2.Weight.codec.decode(input),
maxExtrinsic:
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec).decode(input),
maxTotal:
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec).decode(input),
reserved:
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec).decode(input),
);
}
@override
int sizeHint(WeightsPerClass obj) {
int size = 0;
size = size + _i2.Weight.codec.sizeHint(obj.baseExtrinsic);
size = size +
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec)
.sizeHint(obj.maxExtrinsic);
size = size +
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec)
.sizeHint(obj.maxTotal);
size = size +
const _i1.OptionCodec<_i2.Weight>(_i2.Weight.codec)
.sizeHint(obj.reserved);
return size;
}
}
// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:typed_data' as _i2;
import 'package:polkadart/scale_codec.dart' as _i1;
import 'package:quiver/collection.dart' as _i5;
import '../../primitive_types/h256.dart' as _i4;
import '../../tuples.dart' as _i3;
/// Contains a variant per dispatchable extrinsic that this pallet has.
abstract class Call {
const Call();
factory Call.decode(_i1.Input input) {
return codec.decode(input);
}
static const $CallCodec codec = $CallCodec();
static const $Call values = $Call();
_i2.Uint8List encode() {
final output = _i1.ByteOutput(codec.sizeHint(this));
codec.encodeTo(this, output);
return output.toBytes();
}
int sizeHint() {
return codec.sizeHint(this);
}
Map<String, Map<String, dynamic>> toJson();
}
class $Call {
const $Call();
Remark remark({required List<int> remark}) {
return Remark(remark: remark);
}
SetHeapPages setHeapPages({required BigInt pages}) {
return SetHeapPages(pages: pages);
}
SetCode setCode({required List<int> code}) {
return SetCode(code: code);
}
SetCodeWithoutChecks setCodeWithoutChecks({required List<int> code}) {
return SetCodeWithoutChecks(code: code);
}
SetStorage setStorage(
{required List<_i3.Tuple2<List<int>, List<int>>> items}) {
return SetStorage(items: items);
}
KillStorage killStorage({required List<List<int>> keys}) {
return KillStorage(keys: keys);
}
KillPrefix killPrefix({
required List<int> prefix,
required int subkeys,
}) {
return KillPrefix(
prefix: prefix,
subkeys: subkeys,
);
}
RemarkWithEvent remarkWithEvent({required List<int> remark}) {
return RemarkWithEvent(remark: remark);
}
AuthorizeUpgrade authorizeUpgrade({required _i4.H256 codeHash}) {
return AuthorizeUpgrade(codeHash: codeHash);
}
AuthorizeUpgradeWithoutChecks authorizeUpgradeWithoutChecks(
{required _i4.H256 codeHash}) {
return AuthorizeUpgradeWithoutChecks(codeHash: codeHash);
}
ApplyAuthorizedUpgrade applyAuthorizedUpgrade({required List<int> code}) {
return ApplyAuthorizedUpgrade(code: code);
}
}
class $CallCodec with _i1.Codec<Call> {
const $CallCodec();
@override
Call decode(_i1.Input input) {
final index = _i1.U8Codec.codec.decode(input);
switch (index) {
case 0:
return Remark._decode(input);
case 1:
return SetHeapPages._decode(input);
case 2:
return SetCode._decode(input);
case 3:
return SetCodeWithoutChecks._decode(input);
case 4:
return SetStorage._decode(input);
case 5:
return KillStorage._decode(input);
case 6:
return KillPrefix._decode(input);
case 7:
return RemarkWithEvent._decode(input);
case 9:
return AuthorizeUpgrade._decode(input);
case 10:
return AuthorizeUpgradeWithoutChecks._decode(input);
case 11:
return ApplyAuthorizedUpgrade._decode(input);
default:
throw Exception('Call: Invalid variant index: "$index"');
}
}
@override
void encodeTo(
Call value,
_i1.Output output,
) {
switch (value.runtimeType) {
case Remark:
(value as Remark).encodeTo(output);
break;
case SetHeapPages:
(value as SetHeapPages).encodeTo(output);
break;
case SetCode:
(value as SetCode).encodeTo(output);
break;
case SetCodeWithoutChecks:
(value as SetCodeWithoutChecks).encodeTo(output);
break;
case SetStorage:
(value as SetStorage).encodeTo(output);
break;
case KillStorage:
(value as KillStorage).encodeTo(output);
break;
case KillPrefix:
(value as KillPrefix).encodeTo(output);
break;
case RemarkWithEvent:
(value as RemarkWithEvent).encodeTo(output);
break;
case AuthorizeUpgrade:
(value as AuthorizeUpgrade).encodeTo(output);
break;
case AuthorizeUpgradeWithoutChecks:
(value as AuthorizeUpgradeWithoutChecks).encodeTo(output);
break;
case ApplyAuthorizedUpgrade:
(value as ApplyAuthorizedUpgrade).encodeTo(output);
break;
default:
throw Exception(
'Call: Unsupported "$value" of type "${value.runtimeType}"');
}
}
@override
int sizeHint(Call value) {
switch (value.runtimeType) {
case Remark:
return (value as Remark)._sizeHint();
case SetHeapPages:
return (value as SetHeapPages)._sizeHint();
case SetCode:
return (value as SetCode)._sizeHint();
case SetCodeWithoutChecks:
return (value as SetCodeWithoutChecks)._sizeHint();
case SetStorage:
return (value as SetStorage)._sizeHint();
case KillStorage:
return (value as KillStorage)._sizeHint();
case KillPrefix:
return (value as KillPrefix)._sizeHint();
case RemarkWithEvent:
return (value as RemarkWithEvent)._sizeHint();
case AuthorizeUpgrade:
return (value as AuthorizeUpgrade)._sizeHint();
case AuthorizeUpgradeWithoutChecks:
return (value as AuthorizeUpgradeWithoutChecks)._sizeHint();
case ApplyAuthorizedUpgrade:
return (value as ApplyAuthorizedUpgrade)._sizeHint();
default:
throw Exception(
'Call: Unsupported "$value" of type "${value.runtimeType}"');
}
}
}
/// Make some on-chain remark.
///
/// Can be executed by every `origin`.
class Remark extends Call {
const Remark({required this.remark});
factory Remark._decode(_i1.Input input) {
return Remark(remark: _i1.U8SequenceCodec.codec.decode(input));
}
/// Vec<u8>
final List<int> remark;
@override
Map<String, Map<String, List<int>>> toJson() => {
'remark': {'remark': remark}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(remark);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
0,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
remark,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is Remark &&
_i5.listsEqual(
other.remark,
remark,
);
@override
int get hashCode => remark.hashCode;
}
/// Set the number of pages in the WebAssembly environment's heap.
class SetHeapPages extends Call {
const SetHeapPages({required this.pages});
factory SetHeapPages._decode(_i1.Input input) {
return SetHeapPages(pages: _i1.U64Codec.codec.decode(input));
}
/// u64
final BigInt pages;
@override
Map<String, Map<String, BigInt>> toJson() => {
'set_heap_pages': {'pages': pages}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U64Codec.codec.sizeHint(pages);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
1,
output,
);
_i1.U64Codec.codec.encodeTo(
pages,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is SetHeapPages && other.pages == pages;
@override
int get hashCode => pages.hashCode;
}
/// Set the new runtime code.
class SetCode extends Call {
const SetCode({required this.code});
factory SetCode._decode(_i1.Input input) {
return SetCode(code: _i1.U8SequenceCodec.codec.decode(input));
}
/// Vec<u8>
final List<int> code;
@override
Map<String, Map<String, List<int>>> toJson() => {
'set_code': {'code': code}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(code);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
2,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
code,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is SetCode &&
_i5.listsEqual(
other.code,
code,
);
@override
int get hashCode => code.hashCode;
}
/// Set the new runtime code without doing any checks of the given `code`.
///
/// Note that runtime upgrades will not run if this is called with a not-increasing spec
/// version!
class SetCodeWithoutChecks extends Call {
const SetCodeWithoutChecks({required this.code});
factory SetCodeWithoutChecks._decode(_i1.Input input) {
return SetCodeWithoutChecks(code: _i1.U8SequenceCodec.codec.decode(input));
}
/// Vec<u8>
final List<int> code;
@override
Map<String, Map<String, List<int>>> toJson() => {
'set_code_without_checks': {'code': code}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(code);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
3,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
code,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is SetCodeWithoutChecks &&
_i5.listsEqual(
other.code,
code,
);
@override
int get hashCode => code.hashCode;
}
/// Set some items of storage.
class SetStorage extends Call {
const SetStorage({required this.items});
factory SetStorage._decode(_i1.Input input) {
return SetStorage(
items: const _i1.SequenceCodec<_i3.Tuple2<List<int>, List<int>>>(
_i3.Tuple2Codec<List<int>, List<int>>(
_i1.U8SequenceCodec.codec,
_i1.U8SequenceCodec.codec,
)).decode(input));
}
/// Vec<KeyValue>
final List<_i3.Tuple2<List<int>, List<int>>> items;
@override
Map<String, Map<String, List<List<List<int>>>>> toJson() => {
'set_storage': {
'items': items
.map((value) => [
value.value0,
value.value1,
])
.toList()
}
};
int _sizeHint() {
int size = 1;
size = size +
const _i1.SequenceCodec<_i3.Tuple2<List<int>, List<int>>>(
_i3.Tuple2Codec<List<int>, List<int>>(
_i1.U8SequenceCodec.codec,
_i1.U8SequenceCodec.codec,
)).sizeHint(items);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
4,
output,
);
const _i1.SequenceCodec<_i3.Tuple2<List<int>, List<int>>>(
_i3.Tuple2Codec<List<int>, List<int>>(
_i1.U8SequenceCodec.codec,
_i1.U8SequenceCodec.codec,
)).encodeTo(
items,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is SetStorage &&
_i5.listsEqual(
other.items,
items,
);
@override
int get hashCode => items.hashCode;
}
/// Kill some items from storage.
class KillStorage extends Call {
const KillStorage({required this.keys});
factory KillStorage._decode(_i1.Input input) {
return KillStorage(
keys: const _i1.SequenceCodec<List<int>>(_i1.U8SequenceCodec.codec)
.decode(input));
}
/// Vec<Key>
final List<List<int>> keys;
@override
Map<String, Map<String, List<List<int>>>> toJson() => {
'kill_storage': {'keys': keys.map((value) => value).toList()}
};
int _sizeHint() {
int size = 1;
size = size +
const _i1.SequenceCodec<List<int>>(_i1.U8SequenceCodec.codec)
.sizeHint(keys);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
5,
output,
);
const _i1.SequenceCodec<List<int>>(_i1.U8SequenceCodec.codec).encodeTo(
keys,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is KillStorage &&
_i5.listsEqual(
other.keys,
keys,
);
@override
int get hashCode => keys.hashCode;
}
/// Kill all storage items with a key that starts with the given prefix.
///
/// **NOTE:** We rely on the Root origin to provide us the number of subkeys under
/// the prefix we are removing to accurately calculate the weight of this function.
class KillPrefix extends Call {
const KillPrefix({
required this.prefix,
required this.subkeys,
});
factory KillPrefix._decode(_i1.Input input) {
return KillPrefix(
prefix: _i1.U8SequenceCodec.codec.decode(input),
subkeys: _i1.U32Codec.codec.decode(input),
);
}
/// Key
final List<int> prefix;
/// u32
final int subkeys;
@override
Map<String, Map<String, dynamic>> toJson() => {
'kill_prefix': {
'prefix': prefix,
'subkeys': subkeys,
}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(prefix);
size = size + _i1.U32Codec.codec.sizeHint(subkeys);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
6,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
prefix,
output,
);
_i1.U32Codec.codec.encodeTo(
subkeys,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is KillPrefix &&
_i5.listsEqual(
other.prefix,
prefix,
) &&
other.subkeys == subkeys;
@override
int get hashCode => Object.hash(
prefix,
subkeys,
);
}
/// Make some on-chain remark and emit event.
class RemarkWithEvent extends Call {
const RemarkWithEvent({required this.remark});
factory RemarkWithEvent._decode(_i1.Input input) {
return RemarkWithEvent(remark: _i1.U8SequenceCodec.codec.decode(input));
}
/// Vec<u8>
final List<int> remark;
@override
Map<String, Map<String, List<int>>> toJson() => {
'remark_with_event': {'remark': remark}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(remark);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
7,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
remark,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is RemarkWithEvent &&
_i5.listsEqual(
other.remark,
remark,
);
@override
int get hashCode => remark.hashCode;
}
/// Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied
/// later.
///
/// This call requires Root origin.
class AuthorizeUpgrade extends Call {
const AuthorizeUpgrade({required this.codeHash});
factory AuthorizeUpgrade._decode(_i1.Input input) {
return AuthorizeUpgrade(codeHash: const _i1.U8ArrayCodec(32).decode(input));
}
/// T::Hash
final _i4.H256 codeHash;
@override
Map<String, Map<String, List<int>>> toJson() => {
'authorize_upgrade': {'codeHash': codeHash.toList()}
};
int _sizeHint() {
int size = 1;
size = size + const _i4.H256Codec().sizeHint(codeHash);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
9,
output,
);
const _i1.U8ArrayCodec(32).encodeTo(
codeHash,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is AuthorizeUpgrade &&
_i5.listsEqual(
other.codeHash,
codeHash,
);
@override
int get hashCode => codeHash.hashCode;
}
/// Authorize an upgrade to a given `code_hash` for the runtime. The runtime can be supplied
/// later.
///
/// WARNING: This authorizes an upgrade that will take place without any safety checks, for
/// example that the spec name remains the same and that the version number increases. Not
/// recommended for normal use. Use `authorize_upgrade` instead.
///
/// This call requires Root origin.
class AuthorizeUpgradeWithoutChecks extends Call {
const AuthorizeUpgradeWithoutChecks({required this.codeHash});
factory AuthorizeUpgradeWithoutChecks._decode(_i1.Input input) {
return AuthorizeUpgradeWithoutChecks(
codeHash: const _i1.U8ArrayCodec(32).decode(input));
}
/// T::Hash
final _i4.H256 codeHash;
@override
Map<String, Map<String, List<int>>> toJson() => {
'authorize_upgrade_without_checks': {'codeHash': codeHash.toList()}
};
int _sizeHint() {
int size = 1;
size = size + const _i4.H256Codec().sizeHint(codeHash);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
10,
output,
);
const _i1.U8ArrayCodec(32).encodeTo(
codeHash,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is AuthorizeUpgradeWithoutChecks &&
_i5.listsEqual(
other.codeHash,
codeHash,
);
@override
int get hashCode => codeHash.hashCode;
}
/// Provide the preimage (runtime binary) `code` for an upgrade that has been authorized.
///
/// If the authorization required a version check, this call will ensure the spec name
/// remains unchanged and that the spec version has increased.
///
/// Depending on the runtime's `OnSetCode` configuration, this function may directly apply
/// the new `code` in the same block or attempt to schedule the upgrade.
///
/// All origins are allowed.
class ApplyAuthorizedUpgrade extends Call {
const ApplyAuthorizedUpgrade({required this.code});
factory ApplyAuthorizedUpgrade._decode(_i1.Input input) {
return ApplyAuthorizedUpgrade(
code: _i1.U8SequenceCodec.codec.decode(input));
}
/// Vec<u8>
final List<int> code;
@override
Map<String, Map<String, List<int>>> toJson() => {
'apply_authorized_upgrade': {'code': code}
};
int _sizeHint() {
int size = 1;
size = size + _i1.U8SequenceCodec.codec.sizeHint(code);
return size;
}
void encodeTo(_i1.Output output) {
_i1.U8Codec.codec.encodeTo(
11,
output,
);
_i1.U8SequenceCodec.codec.encodeTo(
code,
output,
);
}
@override
bool operator ==(Object other) =>
identical(
this,
other,
) ||
other is ApplyAuthorizedUpgrade &&
_i5.listsEqual(
other.code,
code,
);
@override
int get hashCode => code.hashCode;
}