Skip to content

Commit

Permalink
Added vsize to WalletTx
Browse files Browse the repository at this point in the history
  • Loading branch information
i5hi committed Jun 11, 2024
1 parent b05fe62 commit 74091be
Show file tree
Hide file tree
Showing 14 changed files with 378 additions and 62 deletions.
1 change: 1 addition & 0 deletions ios/Classes/frb_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef struct wire_cst_tx {
uint64_t fee;
uint32_t *height;
struct wire_cst_list_prim_u_8_strict *unblinded_url;
uintptr_t vsize;
} wire_cst_tx;

typedef struct wire_cst_list_tx {
Expand Down
1 change: 1 addition & 0 deletions lib/src/generated/api/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class Tx with _$Tx {
required int fee,
int? height,
required String unblindedUrl,
required int vsize,
}) = _Tx;
}

Expand Down
35 changes: 28 additions & 7 deletions lib/src/generated/api/types.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ mixin _$Tx {
int get fee => throw _privateConstructorUsedError;
int? get height => throw _privateConstructorUsedError;
String get unblindedUrl => throw _privateConstructorUsedError;
int get vsize => throw _privateConstructorUsedError;

@JsonKey(ignore: true)
$TxCopyWith<Tx> get copyWith => throw _privateConstructorUsedError;
Expand All @@ -463,7 +464,8 @@ abstract class $TxCopyWith<$Res> {
List<TxOut> inputs,
int fee,
int? height,
String unblindedUrl});
String unblindedUrl,
int vsize});
}

/// @nodoc
Expand All @@ -487,6 +489,7 @@ class _$TxCopyWithImpl<$Res, $Val extends Tx> implements $TxCopyWith<$Res> {
Object? fee = null,
Object? height = freezed,
Object? unblindedUrl = null,
Object? vsize = null,
}) {
return _then(_value.copyWith(
timestamp: freezed == timestamp
Expand Down Expand Up @@ -525,6 +528,10 @@ class _$TxCopyWithImpl<$Res, $Val extends Tx> implements $TxCopyWith<$Res> {
? _value.unblindedUrl
: unblindedUrl // ignore: cast_nullable_to_non_nullable
as String,
vsize: null == vsize
? _value.vsize
: vsize // ignore: cast_nullable_to_non_nullable
as int,
) as $Val);
}
}
Expand All @@ -544,7 +551,8 @@ abstract class _$$TxImplCopyWith<$Res> implements $TxCopyWith<$Res> {
List<TxOut> inputs,
int fee,
int? height,
String unblindedUrl});
String unblindedUrl,
int vsize});
}

/// @nodoc
Expand All @@ -565,6 +573,7 @@ class __$$TxImplCopyWithImpl<$Res> extends _$TxCopyWithImpl<$Res, _$TxImpl>
Object? fee = null,
Object? height = freezed,
Object? unblindedUrl = null,
Object? vsize = null,
}) {
return _then(_$TxImpl(
timestamp: freezed == timestamp
Expand Down Expand Up @@ -603,6 +612,10 @@ class __$$TxImplCopyWithImpl<$Res> extends _$TxCopyWithImpl<$Res, _$TxImpl>
? _value.unblindedUrl
: unblindedUrl // ignore: cast_nullable_to_non_nullable
as String,
vsize: null == vsize
? _value.vsize
: vsize // ignore: cast_nullable_to_non_nullable
as int,
));
}
}
Expand All @@ -619,7 +632,8 @@ class _$TxImpl implements _Tx {
required final List<TxOut> inputs,
required this.fee,
this.height,
required this.unblindedUrl})
required this.unblindedUrl,
required this.vsize})
: _balances = balances,
_outputs = outputs,
_inputs = inputs;
Expand Down Expand Up @@ -660,10 +674,12 @@ class _$TxImpl implements _Tx {
final int? height;
@override
final String unblindedUrl;
@override
final int vsize;

@override
String toString() {
return 'Tx(timestamp: $timestamp, kind: $kind, balances: $balances, txid: $txid, outputs: $outputs, inputs: $inputs, fee: $fee, height: $height, unblindedUrl: $unblindedUrl)';
return 'Tx(timestamp: $timestamp, kind: $kind, balances: $balances, txid: $txid, outputs: $outputs, inputs: $inputs, fee: $fee, height: $height, unblindedUrl: $unblindedUrl, vsize: $vsize)';
}

@override
Expand All @@ -681,7 +697,8 @@ class _$TxImpl implements _Tx {
(identical(other.fee, fee) || other.fee == fee) &&
(identical(other.height, height) || other.height == height) &&
(identical(other.unblindedUrl, unblindedUrl) ||
other.unblindedUrl == unblindedUrl));
other.unblindedUrl == unblindedUrl) &&
(identical(other.vsize, vsize) || other.vsize == vsize));
}

@override
Expand All @@ -695,7 +712,8 @@ class _$TxImpl implements _Tx {
const DeepCollectionEquality().hash(_inputs),
fee,
height,
unblindedUrl);
unblindedUrl,
vsize);

@JsonKey(ignore: true)
@override
Expand All @@ -714,7 +732,8 @@ abstract class _Tx implements Tx {
required final List<TxOut> inputs,
required final int fee,
final int? height,
required final String unblindedUrl}) = _$TxImpl;
required final String unblindedUrl,
required final int vsize}) = _$TxImpl;

@override
int? get timestamp;
Expand All @@ -735,6 +754,8 @@ abstract class _Tx implements Tx {
@override
String get unblindedUrl;
@override
int get vsize;
@override
@JsonKey(ignore: true)
_$$TxImplCopyWith<_$TxImpl> get copyWith =>
throw _privateConstructorUsedError;
Expand Down
10 changes: 7 additions & 3 deletions lib/src/generated/frb_generated.dart
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ class LwkCoreApiImpl extends LwkCoreApiImplPlatform implements LwkCoreApi {
Tx dco_decode_tx(dynamic raw) {
// Codec=Dco (DartCObject based), see doc to use other codecs
final arr = raw as List<dynamic>;
if (arr.length != 9)
throw Exception('unexpected arr length: expect 9 but see ${arr.length}');
if (arr.length != 10)
throw Exception('unexpected arr length: expect 10 but see ${arr.length}');
return Tx(
timestamp: dco_decode_opt_box_autoadd_u_32(arr[0]),
kind: dco_decode_String(arr[1]),
Expand All @@ -866,6 +866,7 @@ class LwkCoreApiImpl extends LwkCoreApiImplPlatform implements LwkCoreApi {
fee: dco_decode_u_64(arr[6]),
height: dco_decode_opt_box_autoadd_u_32(arr[7]),
unblindedUrl: dco_decode_String(arr[8]),
vsize: dco_decode_usize(arr[9]),
);
}

Expand Down Expand Up @@ -1137,6 +1138,7 @@ class LwkCoreApiImpl extends LwkCoreApiImplPlatform implements LwkCoreApi {
var var_fee = sse_decode_u_64(deserializer);
var var_height = sse_decode_opt_box_autoadd_u_32(deserializer);
var var_unblindedUrl = sse_decode_String(deserializer);
var var_vsize = sse_decode_usize(deserializer);
return Tx(
timestamp: var_timestamp,
kind: var_kind,
Expand All @@ -1146,7 +1148,8 @@ class LwkCoreApiImpl extends LwkCoreApiImplPlatform implements LwkCoreApi {
inputs: var_inputs,
fee: var_fee,
height: var_height,
unblindedUrl: var_unblindedUrl);
unblindedUrl: var_unblindedUrl,
vsize: var_vsize);
}

@protected
Expand Down Expand Up @@ -1449,6 +1452,7 @@ class LwkCoreApiImpl extends LwkCoreApiImplPlatform implements LwkCoreApi {
sse_encode_u_64(self.fee, serializer);
sse_encode_opt_box_autoadd_u_32(self.height, serializer);
sse_encode_String(self.unblindedUrl, serializer);
sse_encode_usize(self.vsize, serializer);
}

@protected
Expand Down
4 changes: 4 additions & 0 deletions lib/src/generated/frb_generated.io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ abstract class LwkCoreApiImplPlatform extends BaseApiImpl<LwkCoreWire> {
wireObj.fee = cst_encode_u_64(apiObj.fee);
wireObj.height = cst_encode_opt_box_autoadd_u_32(apiObj.height);
wireObj.unblinded_url = cst_encode_String(apiObj.unblindedUrl);
wireObj.vsize = cst_encode_usize(apiObj.vsize);
}

@protected
Expand Down Expand Up @@ -1290,6 +1291,9 @@ final class wire_cst_tx extends ffi.Struct {
external ffi.Pointer<ffi.Uint32> height;

external ffi.Pointer<wire_cst_list_prim_u_8_strict> unblinded_url;

@ffi.UintPtr()
external int vsize;
}

final class wire_cst_list_tx extends ffi.Struct {
Expand Down
3 changes: 2 additions & 1 deletion lib/src/generated/frb_generated.web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ abstract class LwkCoreApiImplPlatform extends BaseApiImpl<LwkCoreWire> {
cst_encode_list_tx_out(raw.inputs),
cst_encode_u_64(raw.fee),
cst_encode_opt_box_autoadd_u_32(raw.height),
cst_encode_String(raw.unblindedUrl)
cst_encode_String(raw.unblindedUrl),
cst_encode_usize(raw.vsize)
];
}

Expand Down
1 change: 1 addition & 0 deletions macos/Classes/frb_generated.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ typedef struct wire_cst_tx {
uint64_t fee;
uint32_t *height;
struct wire_cst_list_prim_u_8_strict *unblinded_url;
uintptr_t vsize;
} wire_cst_tx;

typedef struct wire_cst_list_tx {
Expand Down
Loading

0 comments on commit 74091be

Please sign in to comment.