Skip to content

Commit 3d1a790

Browse files
remaining updates
1 parent 48377eb commit 3d1a790

File tree

5 files changed

+29
-44
lines changed

5 files changed

+29
-44
lines changed

src/lib/mina/v1/local-blockchain.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ async function LocalBlockchain({ proofsEnabled = true, enforceTransactionLimits
261261
errors,
262262
transaction: txn.transaction,
263263
setFee: txn.setFee,
264-
setFeePerSnarkCost: txn.setFeePerSnarkCost,
265264
hash,
266265
toJSON: txn.toJSON,
267266
toPretty: txn.toPretty,

src/lib/mina/v1/mina.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ function Network(
254254
errors: updatedErrors,
255255
transaction: txn.transaction,
256256
setFee: txn.setFee,
257-
setFeePerSnarkCost: txn.setFeePerSnarkCost,
258257
hash,
259258
toJSON: txn.toJSON,
260259
toPretty: txn.toPretty,

src/lib/mina/v1/transaction.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('transactions', () => {
4949
});
5050
let nonce = tx.transaction.feePayer.body.nonce;
5151
let promise = tx.sign([feePayer.key, contractAccount.key]);
52-
let new_fee = promise.setFeePerSnarkCost(42.7);
52+
let new_fee = promise.setFee(new UInt64(42));
5353
await new_fee.sign([feePayer.key, contractAccount.key]);
5454
await new_fee.send();
5555
// check that tx was applied, by checking nonce was incremented

src/lib/mina/v1/transaction.ts

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
1+
import { Types } from '../../../bindings/mina-transaction/v1/types.js';
2+
import { Proof } from '../../proof-system/proof.js';
3+
import { Empty } from '../../proof-system/zkprogram.js';
4+
import { PrivateKey, PublicKey } from '../../provable/crypto/signature.js';
5+
import { UInt32, UInt64 } from '../../provable/int.js';
6+
import { Provable } from '../../provable/provable.js';
7+
import { Field } from '../../provable/wrapped.js';
8+
import { assertPromise } from '../../util/assert.js';
19
import {
2-
ZkappCommand,
310
AccountUpdate,
4-
ZkappPublicInput,
511
AccountUpdateLayout,
612
FeePayerUnsigned,
7-
addMissingSignatures,
813
TokenId,
14+
ZkappCommand,
15+
ZkappPublicInput,
916
addMissingProofs,
17+
addMissingSignatures,
1018
} from './account-update.js';
11-
import { Field } from '../../provable/wrapped.js';
12-
import { PrivateKey, PublicKey } from '../../provable/crypto/signature.js';
13-
import { UInt32, UInt64 } from '../../provable/int.js';
14-
import { Empty } from '../../proof-system/zkprogram.js';
15-
import { Proof } from '../../proof-system/proof.js';
16-
import { currentTransaction } from './transaction-context.js';
17-
import { Provable } from '../../provable/provable.js';
18-
import { assertPreconditionInvariants } from './precondition.js';
1919
import { Account } from './account.js';
20-
import { type FeePayerSpec, activeInstance } from './mina-instance.js';
2120
import * as Fetch from './fetch.js';
22-
import { type SendZkAppResponse, sendZkappQuery } from './graphql.js';
23-
import { type FetchMode } from './transaction-context.js';
24-
import { assertPromise } from '../../util/assert.js';
25-
import { Types } from '../../../bindings/mina-transaction/v1/types.js';
21+
import { sendZkappQuery, type SendZkAppResponse } from './graphql.js';
22+
import { activeInstance, type FeePayerSpec } from './mina-instance.js';
23+
import { assertPreconditionInvariants } from './precondition.js';
24+
import { currentTransaction, type FetchMode } from './transaction-context.js';
2625
import { getTotalTimeRequired } from './transaction-validation.js';
2726

2827
export {
2928
Transaction,
30-
type TransactionPromise,
31-
type PendingTransaction,
32-
type IncludedTransaction,
33-
type RejectedTransaction,
34-
type PendingTransactionPromise,
35-
type PendingTransactionStatus,
29+
createIncludedTransaction,
30+
createRejectedTransaction,
3631
createTransaction,
37-
toTransactionPromise,
38-
toPendingTransactionPromise,
39-
sendTransaction,
40-
newTransaction,
4132
getAccount,
33+
newTransaction,
34+
sendTransaction,
35+
toPendingTransactionPromise,
36+
toTransactionPromise,
4237
transaction,
43-
createRejectedTransaction,
44-
createIncludedTransaction,
38+
type IncludedTransaction,
39+
type PendingTransaction,
40+
type PendingTransactionPromise,
41+
type PendingTransactionStatus,
42+
type RejectedTransaction,
43+
type TransactionPromise
4544
};
4645

4746
type TransactionCommon = {
@@ -141,10 +140,6 @@ type Transaction<Proven extends boolean, Signed extends boolean> = TransactionCo
141140
* ```
142141
*/
143142
setFee(newFee: UInt64): TransactionPromise<Proven, false>;
144-
/**
145-
* setFeePerSnarkCost behaves identically to {@link Transaction.setFee} but the fee is given per estimated cost of snarking the transition as given by {@link getTotalTimeRequired}. This is useful because it should reflect what snark workers would charge in times of network contention.
146-
*/
147-
setFeePerSnarkCost(newFeePerSnarkCost: number): TransactionPromise<Proven, false>;
148143
} & (Proven extends false
149144
? {
150145
/**
@@ -280,10 +275,6 @@ type PendingTransaction = Pick<TransactionCommon, 'transaction' | 'toJSON' | 'to
280275
* setFee is the same as {@link Transaction.setFee(newFee)} but for a {@link PendingTransaction}.
281276
*/
282277
setFee(newFee: UInt64): TransactionPromise<boolean, false>;
283-
/**
284-
* setFeePerSnarkCost is the same as {@link Transaction.setFeePerSnarkCost(newFeePerSnarkCost)} but for a {@link PendingTransaction}.
285-
*/
286-
setFeePerSnarkCost(newFeePerSnarkCost: number): TransactionPromise<boolean, false>;
287278
};
288279

289280
/**
@@ -560,10 +551,6 @@ function newTransaction(transaction: ZkappCommand, proofsEnabled?: boolean) {
560551
}
561552
return pendingTransaction;
562553
},
563-
setFeePerSnarkCost(newFeePerSnarkCost: number) {
564-
let { totalTimeRequired } = getTotalTimeRequired(transaction.accountUpdates);
565-
return this.setFee(new UInt64(Math.round(totalTimeRequired * newFeePerSnarkCost)));
566-
},
567554
setFee(newFee: UInt64) {
568555
return toTransactionPromise(async () => {
569556
self = self as Transaction<false, false>;

src/mina

Submodule mina updated 92 files

0 commit comments

Comments
 (0)