Skip to content

Commit 1741f3c

Browse files
committed
mina-signer/transaction-hash: alias imported UserCommand in UserCommandT
See trivago/prettier-plugin-sort-imports#287
1 parent 36ed592 commit 1741f3c

File tree

1 file changed

+19
-17
lines changed

1 file changed

+19
-17
lines changed

src/mina-signer/src/transaction-hash.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
import { Bool, Field, UInt32, UInt64 } from './field-bigint.js';
1+
import { blake2b } from 'blakejs';
2+
3+
import { versionBytes } from '../../bindings/crypto/constants.js';
24
import {
35
Binable,
46
BinableString,
5-
BinableUint64,
67
BinableUint32,
8+
BinableUint64,
79
defineBinable,
810
enumWithArgument,
911
record,
1012
stringToBytes,
1113
withVersionNumber,
1214
} from '../../bindings/lib/binable.js';
15+
import { base58, withBase58 } from '../../lib/util/base58.js';
16+
17+
import { PublicKey, Scalar } from './curve-bigint.js';
18+
import { Bool, Field, UInt32, UInt64 } from './field-bigint.js';
1319
import {
14-
Common,
15-
Delegation,
16-
Payment,
17-
UserCommand,
18-
UserCommandEnum,
19-
PaymentJson,
20+
Common as CommonT,
2021
DelegationJson,
22+
Delegation as DelegationT,
23+
PaymentJson,
24+
Payment as PaymentT,
25+
UserCommandEnum,
26+
UserCommand as UserCommandT,
2127
delegationFromJson,
2228
paymentFromJson,
2329
} from './sign-legacy.js';
24-
import { PublicKey, Scalar } from './curve-bigint.js';
2530
import { Signature, SignatureJson } from './signature.js';
26-
import { blake2b } from 'blakejs';
27-
import { base58, withBase58 } from '../../lib/util/base58.js';
28-
import { versionBytes } from '../../bindings/crypto/constants.js';
2931

3032
export {
3133
hashPayment,
@@ -72,7 +74,7 @@ function hashSignedCommand(command: SignedCommand) {
7274

7375
// helper
7476

75-
function userCommandToEnum({ common, body }: UserCommand): UserCommandEnum {
77+
function userCommandToEnum({ common, body }: UserCommandT): UserCommandEnum {
7678
let { tag: type, ...value } = body;
7779
switch (type) {
7880
case 'Payment':
@@ -95,12 +97,12 @@ function userCommandToEnum({ common, body }: UserCommand): UserCommandEnum {
9597
// binable
9698

9799
let BinablePublicKey = record({ x: Field, isOdd: Bool }, ['x', 'isOdd']);
98-
type GlobalSlotSinceGenesis = Common['validUntil'];
100+
type GlobalSlotSinceGenesis = CommonT['validUntil'];
99101
let GlobalSlotSinceGenesis = enumWithArgument<[GlobalSlotSinceGenesis]>([
100102
{ type: 'SinceGenesis', value: BinableUint32 },
101103
]);
102104

103-
const Common = record<Common>(
105+
const Common = record<CommonT>(
104106
{
105107
fee: BinableUint64,
106108
feePayer: BinablePublicKey,
@@ -110,14 +112,14 @@ const Common = record<Common>(
110112
},
111113
['fee', 'feePayer', 'nonce', 'validUntil', 'memo']
112114
);
113-
const Payment = record<Payment>(
115+
const Payment = record<PaymentT>(
114116
{
115117
receiver: BinablePublicKey,
116118
amount: BinableUint64,
117119
},
118120
['receiver', 'amount']
119121
);
120-
const Delegation = record<Delegation>({ newDelegate: BinablePublicKey }, ['newDelegate']);
122+
const Delegation = record<DelegationT>({ newDelegate: BinablePublicKey }, ['newDelegate']);
121123
type DelegationEnum = { type: 'SetDelegate'; value: Delegation };
122124
const DelegationEnum = enumWithArgument<[DelegationEnum]>([
123125
{ type: 'SetDelegate', value: Delegation },

0 commit comments

Comments
 (0)