Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(grpc): revert GetRawTransfer method and undo deprecation #1560

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions www/grpc/buf/grpc-gateway.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ http:
- selector: pactus.Transaction.CalculateFee
get: "/pactus/transaction/calculate_fee"

- selector: pactus.Transaction.GetRawTransaction
get: "/pactus/transaction/get_raw_transaction"
- selector: pactus.Transaction.GetRawTransferTransaction
get: "/pactus/transaction/get_raw_transfer_transaction"

- selector: pactus.Transaction.GetRawBondTransaction
get: "/pactus/transaction/get_raw_bond_transaction"

- selector: pactus.Transaction.GetRawUnbondTransaction
get: "/pactus/transaction/get_raw_unbond_transaction"

- selector: pactus.Transaction.GetRawWithdrawTransaction
get: "/pactus/transaction/get_raw_withdraw_transaction"

# Network APIs
- selector: pactus.Network.GetNetworkInfo
Expand Down
162 changes: 0 additions & 162 deletions www/grpc/gen/dart/transaction.pb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -383,164 +383,6 @@ class BroadcastTransactionResponse extends $pb.GeneratedMessage {
void clearId() => clearField(1);
}

enum GetRawTransactionRequest_Payload {
transfer,
bond,
unbond,
withdraw,
notSet
}

class GetRawTransactionRequest extends $pb.GeneratedMessage {
static const $core.Map<$core.int, GetRawTransactionRequest_Payload> _GetRawTransactionRequest_PayloadByTag = {
4 : GetRawTransactionRequest_Payload.transfer,
5 : GetRawTransactionRequest_Payload.bond,
6 : GetRawTransactionRequest_Payload.unbond,
7 : GetRawTransactionRequest_Payload.withdraw,
0 : GetRawTransactionRequest_Payload.notSet
};
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRawTransactionRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..oo(0, [4, 5, 6, 7])
..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lockTime', $pb.PbFieldType.OU3)
..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'memo')
..aInt64(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'fee')
..aOM<PayloadTransfer>(4, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'transfer', subBuilder: PayloadTransfer.create)
..aOM<PayloadBond>(5, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'bond', subBuilder: PayloadBond.create)
..aOM<PayloadUnbond>(6, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'unbond', subBuilder: PayloadUnbond.create)
..aOM<PayloadWithdraw>(7, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'withdraw', subBuilder: PayloadWithdraw.create)
..hasRequiredFields = false
;

GetRawTransactionRequest._() : super();
factory GetRawTransactionRequest({
$core.int? lockTime,
$core.String? memo,
$fixnum.Int64? fee,
PayloadTransfer? transfer,
PayloadBond? bond,
PayloadUnbond? unbond,
PayloadWithdraw? withdraw,
}) {
final _result = create();
if (lockTime != null) {
_result.lockTime = lockTime;
}
if (memo != null) {
_result.memo = memo;
}
if (fee != null) {
_result.fee = fee;
}
if (transfer != null) {
_result.transfer = transfer;
}
if (bond != null) {
_result.bond = bond;
}
if (unbond != null) {
_result.unbond = unbond;
}
if (withdraw != null) {
_result.withdraw = withdraw;
}
return _result;
}
factory GetRawTransactionRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
factory GetRawTransactionRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
'Will be removed in next major version')
GetRawTransactionRequest clone() => GetRawTransactionRequest()..mergeFromMessage(this);
@$core.Deprecated(
'Using this can add significant overhead to your binary. '
'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
'Will be removed in next major version')
GetRawTransactionRequest copyWith(void Function(GetRawTransactionRequest) updates) => super.copyWith((message) => updates(message as GetRawTransactionRequest)) as GetRawTransactionRequest; // ignore: deprecated_member_use
$pb.BuilderInfo get info_ => _i;
@$core.pragma('dart2js:noInline')
static GetRawTransactionRequest create() => GetRawTransactionRequest._();
GetRawTransactionRequest createEmptyInstance() => create();
static $pb.PbList<GetRawTransactionRequest> createRepeated() => $pb.PbList<GetRawTransactionRequest>();
@$core.pragma('dart2js:noInline')
static GetRawTransactionRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<GetRawTransactionRequest>(create);
static GetRawTransactionRequest? _defaultInstance;

GetRawTransactionRequest_Payload whichPayload() => _GetRawTransactionRequest_PayloadByTag[$_whichOneof(0)]!;
void clearPayload() => clearField($_whichOneof(0));

@$pb.TagNumber(1)
$core.int get lockTime => $_getIZ(0);
@$pb.TagNumber(1)
set lockTime($core.int v) { $_setUnsignedInt32(0, v); }
@$pb.TagNumber(1)
$core.bool hasLockTime() => $_has(0);
@$pb.TagNumber(1)
void clearLockTime() => clearField(1);

@$pb.TagNumber(2)
$core.String get memo => $_getSZ(1);
@$pb.TagNumber(2)
set memo($core.String v) { $_setString(1, v); }
@$pb.TagNumber(2)
$core.bool hasMemo() => $_has(1);
@$pb.TagNumber(2)
void clearMemo() => clearField(2);

@$pb.TagNumber(3)
$fixnum.Int64 get fee => $_getI64(2);
@$pb.TagNumber(3)
set fee($fixnum.Int64 v) { $_setInt64(2, v); }
@$pb.TagNumber(3)
$core.bool hasFee() => $_has(2);
@$pb.TagNumber(3)
void clearFee() => clearField(3);

@$pb.TagNumber(4)
PayloadTransfer get transfer => $_getN(3);
@$pb.TagNumber(4)
set transfer(PayloadTransfer v) { setField(4, v); }
@$pb.TagNumber(4)
$core.bool hasTransfer() => $_has(3);
@$pb.TagNumber(4)
void clearTransfer() => clearField(4);
@$pb.TagNumber(4)
PayloadTransfer ensureTransfer() => $_ensure(3);

@$pb.TagNumber(5)
PayloadBond get bond => $_getN(4);
@$pb.TagNumber(5)
set bond(PayloadBond v) { setField(5, v); }
@$pb.TagNumber(5)
$core.bool hasBond() => $_has(4);
@$pb.TagNumber(5)
void clearBond() => clearField(5);
@$pb.TagNumber(5)
PayloadBond ensureBond() => $_ensure(4);

@$pb.TagNumber(6)
PayloadUnbond get unbond => $_getN(5);
@$pb.TagNumber(6)
set unbond(PayloadUnbond v) { setField(6, v); }
@$pb.TagNumber(6)
$core.bool hasUnbond() => $_has(5);
@$pb.TagNumber(6)
void clearUnbond() => clearField(6);
@$pb.TagNumber(6)
PayloadUnbond ensureUnbond() => $_ensure(5);

@$pb.TagNumber(7)
PayloadWithdraw get withdraw => $_getN(6);
@$pb.TagNumber(7)
set withdraw(PayloadWithdraw v) { setField(7, v); }
@$pb.TagNumber(7)
$core.bool hasWithdraw() => $_has(6);
@$pb.TagNumber(7)
void clearWithdraw() => clearField(7);
@$pb.TagNumber(7)
PayloadWithdraw ensureWithdraw() => $_ensure(6);
}

class GetRawTransferTransactionRequest extends $pb.GeneratedMessage {
static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'GetRawTransferTransactionRequest', package: const $pb.PackageName(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'pactus'), createEmptyInstance: create)
..a<$core.int>(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'lockTime', $pb.PbFieldType.OU3)
Expand Down Expand Up @@ -1679,10 +1521,6 @@ class TransactionApi {
var emptyResponse = BroadcastTransactionResponse();
return _client.invoke<BroadcastTransactionResponse>(ctx, 'Transaction', 'BroadcastTransaction', request, emptyResponse);
}
$async.Future<GetRawTransactionResponse> getRawTransaction($pb.ClientContext? ctx, GetRawTransactionRequest request) {
var emptyResponse = GetRawTransactionResponse();
return _client.invoke<GetRawTransactionResponse>(ctx, 'Transaction', 'GetRawTransaction', request, emptyResponse);
}
$async.Future<GetRawTransactionResponse> getRawTransferTransaction($pb.ClientContext? ctx, GetRawTransferTransactionRequest request) {
var emptyResponse = GetRawTransactionResponse();
return _client.invoke<GetRawTransactionResponse>(ctx, 'Transaction', 'GetRawTransferTransaction', request, emptyResponse);
Expand Down
25 changes: 2 additions & 23 deletions www/grpc/gen/dart/transaction.pbjson.dart
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,6 @@ const BroadcastTransactionResponse$json = const {

/// Descriptor for `BroadcastTransactionResponse`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List broadcastTransactionResponseDescriptor = $convert.base64Decode('ChxCcm9hZGNhc3RUcmFuc2FjdGlvblJlc3BvbnNlEg4KAmlkGAEgASgJUgJpZA==');
@$core.Deprecated('Use getRawTransactionRequestDescriptor instead')
const GetRawTransactionRequest$json = const {
'1': 'GetRawTransactionRequest',
'2': const [
const {'1': 'lock_time', '3': 1, '4': 1, '5': 13, '10': 'lockTime'},
const {'1': 'memo', '3': 2, '4': 1, '5': 9, '10': 'memo'},
const {'1': 'fee', '3': 3, '4': 1, '5': 3, '10': 'fee'},
const {'1': 'transfer', '3': 4, '4': 1, '5': 11, '6': '.pactus.PayloadTransfer', '9': 0, '10': 'transfer'},
const {'1': 'bond', '3': 5, '4': 1, '5': 11, '6': '.pactus.PayloadBond', '9': 0, '10': 'bond'},
const {'1': 'unbond', '3': 6, '4': 1, '5': 11, '6': '.pactus.PayloadUnbond', '9': 0, '10': 'unbond'},
const {'1': 'withdraw', '3': 7, '4': 1, '5': 11, '6': '.pactus.PayloadWithdraw', '9': 0, '10': 'withdraw'},
],
'8': const [
const {'1': 'payload'},
],
};

/// Descriptor for `GetRawTransactionRequest`. Decode as a `google.protobuf.DescriptorProto`.
final $typed_data.Uint8List getRawTransactionRequestDescriptor = $convert.base64Decode('ChhHZXRSYXdUcmFuc2FjdGlvblJlcXVlc3QSGwoJbG9ja190aW1lGAEgASgNUghsb2NrVGltZRISCgRtZW1vGAIgASgJUgRtZW1vEhAKA2ZlZRgDIAEoA1IDZmVlEjUKCHRyYW5zZmVyGAQgASgLMhcucGFjdHVzLlBheWxvYWRUcmFuc2ZlckgAUgh0cmFuc2ZlchIpCgRib25kGAUgASgLMhMucGFjdHVzLlBheWxvYWRCb25kSABSBGJvbmQSLwoGdW5ib25kGAYgASgLMhUucGFjdHVzLlBheWxvYWRVbmJvbmRIAFIGdW5ib25kEjUKCHdpdGhkcmF3GAcgASgLMhcucGFjdHVzLlBheWxvYWRXaXRoZHJhd0gAUgh3aXRoZHJhd0IJCgdwYXlsb2Fk');
@$core.Deprecated('Use getRawTransferTransactionRequestDescriptor instead')
const GetRawTransferTransactionRequest$json = const {
'1': 'GetRawTransferTransactionRequest',
Expand Down Expand Up @@ -279,7 +260,6 @@ const $core.Map<$core.String, $core.dynamic> TransactionServiceBase$json = const
const {'1': 'GetTransaction', '2': '.pactus.GetTransactionRequest', '3': '.pactus.GetTransactionResponse'},
const {'1': 'CalculateFee', '2': '.pactus.CalculateFeeRequest', '3': '.pactus.CalculateFeeResponse'},
const {'1': 'BroadcastTransaction', '2': '.pactus.BroadcastTransactionRequest', '3': '.pactus.BroadcastTransactionResponse'},
const {'1': 'GetRawTransaction', '2': '.pactus.GetRawTransactionRequest', '3': '.pactus.GetRawTransactionResponse'},
const {'1': 'GetRawTransferTransaction', '2': '.pactus.GetRawTransferTransactionRequest', '3': '.pactus.GetRawTransactionResponse'},
const {'1': 'GetRawBondTransaction', '2': '.pactus.GetRawBondTransactionRequest', '3': '.pactus.GetRawTransactionResponse'},
const {'1': 'GetRawUnbondTransaction', '2': '.pactus.GetRawUnbondTransactionRequest', '3': '.pactus.GetRawTransactionResponse'},
Expand All @@ -301,13 +281,12 @@ const $core.Map<$core.String, $core.Map<$core.String, $core.dynamic>> Transactio
'.pactus.CalculateFeeResponse': CalculateFeeResponse$json,
'.pactus.BroadcastTransactionRequest': BroadcastTransactionRequest$json,
'.pactus.BroadcastTransactionResponse': BroadcastTransactionResponse$json,
'.pactus.GetRawTransactionRequest': GetRawTransactionRequest$json,
'.pactus.GetRawTransactionResponse': GetRawTransactionResponse$json,
'.pactus.GetRawTransferTransactionRequest': GetRawTransferTransactionRequest$json,
'.pactus.GetRawTransactionResponse': GetRawTransactionResponse$json,
'.pactus.GetRawBondTransactionRequest': GetRawBondTransactionRequest$json,
'.pactus.GetRawUnbondTransactionRequest': GetRawUnbondTransactionRequest$json,
'.pactus.GetRawWithdrawTransactionRequest': GetRawWithdrawTransactionRequest$json,
};

/// Descriptor for `Transaction`. Decode as a `google.protobuf.ServiceDescriptorProto`.
final $typed_data.Uint8List transactionServiceDescriptor = $convert.base64Decode('CgtUcmFuc2FjdGlvbhJPCg5HZXRUcmFuc2FjdGlvbhIdLnBhY3R1cy5HZXRUcmFuc2FjdGlvblJlcXVlc3QaHi5wYWN0dXMuR2V0VHJhbnNhY3Rpb25SZXNwb25zZRJJCgxDYWxjdWxhdGVGZWUSGy5wYWN0dXMuQ2FsY3VsYXRlRmVlUmVxdWVzdBocLnBhY3R1cy5DYWxjdWxhdGVGZWVSZXNwb25zZRJhChRCcm9hZGNhc3RUcmFuc2FjdGlvbhIjLnBhY3R1cy5Ccm9hZGNhc3RUcmFuc2FjdGlvblJlcXVlc3QaJC5wYWN0dXMuQnJvYWRjYXN0VHJhbnNhY3Rpb25SZXNwb25zZRJYChFHZXRSYXdUcmFuc2FjdGlvbhIgLnBhY3R1cy5HZXRSYXdUcmFuc2FjdGlvblJlcXVlc3QaIS5wYWN0dXMuR2V0UmF3VHJhbnNhY3Rpb25SZXNwb25zZRJoChlHZXRSYX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W5zYWN0aW9uUmVzcG9uc2USYAoVR2V0UmF3Qm9uZFRyYW5zYWN0aW9uEiQucGFjdHVzLkdldFJhd0JvbmRUcmFuc2FjdGlvblJlcXVlc3QaIS5wYWN0dXMuR2V0UmF3VHJhbnNhY3Rpb25SZXNwb25zZRJkChdHZXRSYXdVbmJvbmRUcmFuc2FjdGlvbhImLnBhY3R1cy5HZXRSYXdVbmJvbmRUcmFuc2FjdGlvblJlcXVlc3QaIS5wYWN0dXMuR2V0UmF3VHJhbnNhY3Rpb25SZXNwb25zZRJoChlHZXRSYXdXaXRoZHJhd1RyYW5zYWN0aW9uEigucGFjdHVzLkdldFJhd1dpdGhkcmF3VHJhbnNhY3Rpb25SZXF1ZXN0GiEucGFjdHVzLkdldFJhd1RyYW5zYWN0aW9uUmVzcG9uc2U=');
3 changes: 0 additions & 3 deletions www/grpc/gen/dart/transaction.pbserver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ abstract class TransactionServiceBase extends $pb.GeneratedService {
$async.Future<$0.GetTransactionResponse> getTransaction($pb.ServerContext ctx, $0.GetTransactionRequest request);
$async.Future<$0.CalculateFeeResponse> calculateFee($pb.ServerContext ctx, $0.CalculateFeeRequest request);
$async.Future<$0.BroadcastTransactionResponse> broadcastTransaction($pb.ServerContext ctx, $0.BroadcastTransactionRequest request);
$async.Future<$0.GetRawTransactionResponse> getRawTransaction($pb.ServerContext ctx, $0.GetRawTransactionRequest request);
$async.Future<$0.GetRawTransactionResponse> getRawTransferTransaction($pb.ServerContext ctx, $0.GetRawTransferTransactionRequest request);
$async.Future<$0.GetRawTransactionResponse> getRawBondTransaction($pb.ServerContext ctx, $0.GetRawBondTransactionRequest request);
$async.Future<$0.GetRawTransactionResponse> getRawUnbondTransaction($pb.ServerContext ctx, $0.GetRawUnbondTransactionRequest request);
Expand All @@ -30,7 +29,6 @@ abstract class TransactionServiceBase extends $pb.GeneratedService {
case 'GetTransaction': return $0.GetTransactionRequest();
case 'CalculateFee': return $0.CalculateFeeRequest();
case 'BroadcastTransaction': return $0.BroadcastTransactionRequest();
case 'GetRawTransaction': return $0.GetRawTransactionRequest();
case 'GetRawTransferTransaction': return $0.GetRawTransferTransactionRequest();
case 'GetRawBondTransaction': return $0.GetRawBondTransactionRequest();
case 'GetRawUnbondTransaction': return $0.GetRawUnbondTransactionRequest();
Expand All @@ -44,7 +42,6 @@ abstract class TransactionServiceBase extends $pb.GeneratedService {
case 'GetTransaction': return this.getTransaction(ctx, request as $0.GetTransactionRequest);
case 'CalculateFee': return this.calculateFee(ctx, request as $0.CalculateFeeRequest);
case 'BroadcastTransaction': return this.broadcastTransaction(ctx, request as $0.BroadcastTransactionRequest);
case 'GetRawTransaction': return this.getRawTransaction(ctx, request as $0.GetRawTransactionRequest);
case 'GetRawTransferTransaction': return this.getRawTransferTransaction(ctx, request as $0.GetRawTransferTransactionRequest);
case 'GetRawBondTransaction': return this.getRawBondTransaction(ctx, request as $0.GetRawBondTransactionRequest);
case 'GetRawUnbondTransaction': return this.getRawUnbondTransaction(ctx, request as $0.GetRawUnbondTransactionRequest);
Expand Down
Loading
Loading