@proto-kit/protocol 0.1.1-develop.165 → 0.1.1-develop.1661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Constants.js +1 -0
- package/dist/Constants.js.map +1 -0
- package/dist/hashing/mina-prefixes.d.ts +10 -0
- package/dist/hashing/mina-prefixes.d.ts.map +1 -0
- package/dist/hashing/mina-prefixes.js +10 -0
- package/dist/hashing/mina-prefixes.js.map +1 -0
- package/dist/hashing/protokit-prefixes.d.ts +10 -0
- package/dist/hashing/protokit-prefixes.d.ts.map +1 -0
- package/dist/hashing/protokit-prefixes.js +24 -0
- package/dist/hashing/protokit-prefixes.js.map +1 -0
- package/dist/hooks/AccountStateHook.d.ts +52 -0
- package/dist/hooks/AccountStateHook.d.ts.map +1 -0
- package/dist/hooks/AccountStateHook.js +52 -0
- package/dist/hooks/AccountStateHook.js.map +1 -0
- package/dist/hooks/BlockHeightHook.d.ts +7 -0
- package/dist/hooks/BlockHeightHook.d.ts.map +1 -0
- package/dist/hooks/BlockHeightHook.js +16 -0
- package/dist/hooks/BlockHeightHook.js.map +1 -0
- package/dist/hooks/LastStateRootBlockHook.d.ts +7 -0
- package/dist/hooks/LastStateRootBlockHook.d.ts.map +1 -0
- package/dist/hooks/LastStateRootBlockHook.js +16 -0
- package/dist/hooks/LastStateRootBlockHook.js.map +1 -0
- package/dist/hooks/NoopBlockHook.d.ts +8 -0
- package/dist/hooks/NoopBlockHook.d.ts.map +1 -0
- package/dist/hooks/NoopBlockHook.js +10 -0
- package/dist/hooks/NoopBlockHook.js.map +1 -0
- package/dist/hooks/NoopSettlementHook.d.ts +6 -0
- package/dist/hooks/NoopSettlementHook.d.ts.map +1 -0
- package/dist/{prover/statetransition/StateTransitionWitnessProvider.js → hooks/NoopSettlementHook.js} +8 -7
- package/dist/hooks/NoopSettlementHook.js.map +1 -0
- package/dist/hooks/NoopTransactionHook.d.ts +6 -0
- package/dist/hooks/NoopTransactionHook.d.ts.map +1 -0
- package/dist/hooks/NoopTransactionHook.js +11 -0
- package/dist/hooks/NoopTransactionHook.js.map +1 -0
- package/dist/index.d.ts +51 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -9
- package/dist/index.js.map +1 -0
- package/dist/model/AppliedStateTransitionBatch.d.ts +114 -0
- package/dist/model/AppliedStateTransitionBatch.d.ts.map +1 -0
- package/dist/model/AppliedStateTransitionBatch.js +16 -0
- package/dist/model/AppliedStateTransitionBatch.js.map +1 -0
- package/dist/model/MethodPublicOutput.d.ts +83 -29
- package/dist/model/MethodPublicOutput.d.ts.map +1 -1
- package/dist/model/MethodPublicOutput.js +4 -1
- package/dist/model/MethodPublicOutput.js.map +1 -0
- package/dist/model/Option.d.ts +70 -42
- package/dist/model/Option.d.ts.map +1 -1
- package/dist/model/Option.js +62 -47
- package/dist/model/Option.js.map +1 -0
- package/dist/model/Path.d.ts +4 -3
- package/dist/model/Path.d.ts.map +1 -1
- package/dist/model/Path.js +6 -5
- package/dist/model/Path.js.map +1 -0
- package/dist/model/RuntimeLike.d.ts +11 -0
- package/dist/model/RuntimeLike.d.ts.map +1 -0
- package/dist/model/RuntimeLike.js +2 -0
- package/dist/model/RuntimeLike.js.map +1 -0
- package/dist/model/StateTransition.d.ts +67 -16
- package/dist/model/StateTransition.d.ts.map +1 -1
- package/dist/model/StateTransition.js +18 -2
- package/dist/model/StateTransition.js.map +1 -0
- package/dist/model/StateTransitionProvableBatch.d.ts +389 -16
- package/dist/model/StateTransitionProvableBatch.d.ts.map +1 -1
- package/dist/model/StateTransitionProvableBatch.js +88 -11
- package/dist/model/StateTransitionProvableBatch.js.map +1 -0
- package/dist/model/network/NetworkState.d.ts +105 -9
- package/dist/model/network/NetworkState.d.ts.map +1 -1
- package/dist/model/network/NetworkState.js +20 -2
- package/dist/model/network/NetworkState.js.map +1 -0
- package/dist/model/transaction/RuntimeTransaction.d.ts +96 -28
- package/dist/model/transaction/RuntimeTransaction.d.ts.map +1 -1
- package/dist/model/transaction/RuntimeTransaction.js +75 -11
- package/dist/model/transaction/RuntimeTransaction.js.map +1 -0
- package/dist/model/transaction/SignedTransaction.d.ts +107 -0
- package/dist/model/transaction/SignedTransaction.d.ts.map +1 -0
- package/dist/model/transaction/SignedTransaction.js +34 -0
- package/dist/model/transaction/SignedTransaction.js.map +1 -0
- package/dist/model/transaction/ValueOption.d.ts +173 -0
- package/dist/model/transaction/ValueOption.d.ts.map +1 -0
- package/dist/model/transaction/ValueOption.js +25 -0
- package/dist/model/transaction/ValueOption.js.map +1 -0
- package/dist/protocol/Protocol.d.ts +27 -25
- package/dist/protocol/Protocol.d.ts.map +1 -1
- package/dist/protocol/Protocol.js +98 -28
- package/dist/protocol/Protocol.js.map +1 -0
- package/dist/protocol/ProtocolEnvironment.d.ts +9 -0
- package/dist/protocol/ProtocolEnvironment.d.ts.map +1 -0
- package/dist/protocol/ProtocolEnvironment.js +2 -0
- package/dist/protocol/ProtocolEnvironment.js.map +1 -0
- package/dist/protocol/ProtocolModule.d.ts +7 -7
- package/dist/protocol/ProtocolModule.d.ts.map +1 -1
- package/dist/protocol/ProtocolModule.js +10 -7
- package/dist/protocol/ProtocolModule.js.map +1 -0
- package/dist/protocol/ProvableBlockHook.d.ts +19 -0
- package/dist/protocol/ProvableBlockHook.d.ts.map +1 -0
- package/dist/protocol/ProvableBlockHook.js +21 -0
- package/dist/protocol/ProvableBlockHook.js.map +1 -0
- package/dist/protocol/ProvableTransactionHook.d.ts +34 -0
- package/dist/protocol/ProvableTransactionHook.d.ts.map +1 -0
- package/dist/protocol/ProvableTransactionHook.js +13 -0
- package/dist/protocol/ProvableTransactionHook.js.map +1 -0
- package/dist/protocol/TransitioningProtocolModule.d.ts +10 -0
- package/dist/protocol/TransitioningProtocolModule.d.ts.map +1 -0
- package/dist/protocol/TransitioningProtocolModule.js +9 -0
- package/dist/protocol/TransitioningProtocolModule.js.map +1 -0
- package/dist/prover/accumulators/AppliedBatchHashList.d.ts +18 -0
- package/dist/prover/accumulators/AppliedBatchHashList.d.ts.map +1 -0
- package/dist/prover/accumulators/AppliedBatchHashList.js +25 -0
- package/dist/prover/accumulators/AppliedBatchHashList.js.map +1 -0
- package/dist/prover/accumulators/StateTransitionReductionList.d.ts +12 -0
- package/dist/prover/accumulators/StateTransitionReductionList.d.ts.map +1 -0
- package/dist/prover/accumulators/StateTransitionReductionList.js +64 -0
- package/dist/prover/accumulators/StateTransitionReductionList.js.map +1 -0
- package/dist/prover/accumulators/TransactionHashList.d.ts +6 -0
- package/dist/prover/accumulators/TransactionHashList.d.ts.map +1 -0
- package/dist/prover/accumulators/TransactionHashList.js +8 -0
- package/dist/prover/accumulators/TransactionHashList.js.map +1 -0
- package/dist/prover/accumulators/WitnessedRootHashList.d.ts +137 -0
- package/dist/prover/accumulators/WitnessedRootHashList.d.ts.map +1 -0
- package/dist/prover/accumulators/WitnessedRootHashList.js +50 -0
- package/dist/prover/accumulators/WitnessedRootHashList.js.map +1 -0
- package/dist/prover/block/BlockProvable.d.ts +869 -65
- package/dist/prover/block/BlockProvable.d.ts.map +1 -1
- package/dist/prover/block/BlockProvable.js +86 -6
- package/dist/prover/block/BlockProvable.js.map +1 -0
- package/dist/prover/block/BlockProver.d.ts +82 -34
- package/dist/prover/block/BlockProver.d.ts.map +1 -1
- package/dist/prover/block/BlockProver.js +505 -86
- package/dist/prover/block/BlockProver.js.map +1 -0
- package/dist/prover/block/accummulators/BlockHashMerkleTree.d.ts +106 -0
- package/dist/prover/block/accummulators/BlockHashMerkleTree.d.ts.map +1 -0
- package/dist/prover/block/accummulators/BlockHashMerkleTree.js +25 -0
- package/dist/prover/block/accummulators/BlockHashMerkleTree.js.map +1 -0
- package/dist/prover/block/accummulators/RuntimeVerificationKeyTree.d.ts +139 -0
- package/dist/prover/block/accummulators/RuntimeVerificationKeyTree.d.ts.map +1 -0
- package/dist/prover/block/accummulators/RuntimeVerificationKeyTree.js +21 -0
- package/dist/prover/block/accummulators/RuntimeVerificationKeyTree.js.map +1 -0
- package/dist/prover/block/services/RuntimeVerificationKeyRootService.d.ts +7 -0
- package/dist/prover/block/services/RuntimeVerificationKeyRootService.d.ts.map +1 -0
- package/dist/prover/{statetransition/StateTransitionWitnessProviderReference.js → block/services/RuntimeVerificationKeyRootService.js} +11 -8
- package/dist/prover/block/services/RuntimeVerificationKeyRootService.js.map +1 -0
- package/dist/prover/statetransition/StateTransitionProvable.d.ts +137 -48
- package/dist/prover/statetransition/StateTransitionProvable.d.ts.map +1 -1
- package/dist/prover/statetransition/StateTransitionProvable.js +10 -5
- package/dist/prover/statetransition/StateTransitionProvable.js.map +1 -0
- package/dist/prover/statetransition/StateTransitionProver.d.ts +30 -17
- package/dist/prover/statetransition/StateTransitionProver.d.ts.map +1 -1
- package/dist/prover/statetransition/StateTransitionProver.js +169 -74
- package/dist/prover/statetransition/StateTransitionProver.js.map +1 -0
- package/dist/settlement/ContractModule.d.ts +16 -0
- package/dist/settlement/ContractModule.d.ts.map +1 -0
- package/dist/settlement/ContractModule.js +12 -0
- package/dist/settlement/ContractModule.js.map +1 -0
- package/dist/settlement/SettlementContractModule.d.ts +51 -0
- package/dist/settlement/SettlementContractModule.d.ts.map +1 -0
- package/dist/settlement/SettlementContractModule.js +80 -0
- package/dist/settlement/SettlementContractModule.js.map +1 -0
- package/dist/settlement/contracts/BridgeContract.d.ts +116 -0
- package/dist/settlement/contracts/BridgeContract.d.ts.map +1 -0
- package/dist/settlement/contracts/BridgeContract.js +259 -0
- package/dist/settlement/contracts/BridgeContract.js.map +1 -0
- package/dist/settlement/contracts/BridgeContractProtocolModule.d.ts +16 -0
- package/dist/settlement/contracts/BridgeContractProtocolModule.d.ts.map +1 -0
- package/dist/settlement/contracts/BridgeContractProtocolModule.js +41 -0
- package/dist/settlement/contracts/BridgeContractProtocolModule.js.map +1 -0
- package/dist/settlement/contracts/DispatchContractProtocolModule.d.ts +21 -0
- package/dist/settlement/contracts/DispatchContractProtocolModule.d.ts.map +1 -0
- package/dist/settlement/contracts/DispatchContractProtocolModule.js +57 -0
- package/dist/settlement/contracts/DispatchContractProtocolModule.js.map +1 -0
- package/dist/settlement/contracts/DispatchSmartContract.d.ts +44 -0
- package/dist/settlement/contracts/DispatchSmartContract.d.ts.map +1 -0
- package/dist/settlement/contracts/DispatchSmartContract.js +229 -0
- package/dist/settlement/contracts/DispatchSmartContract.js.map +1 -0
- package/dist/settlement/contracts/SettlementContractProtocolModule.d.ts +21 -0
- package/dist/settlement/contracts/SettlementContractProtocolModule.d.ts.map +1 -0
- package/dist/settlement/contracts/SettlementContractProtocolModule.js +84 -0
- package/dist/settlement/contracts/SettlementContractProtocolModule.js.map +1 -0
- package/dist/settlement/contracts/SettlementSmartContract.d.ts +123 -0
- package/dist/settlement/contracts/SettlementSmartContract.d.ts.map +1 -0
- package/dist/settlement/contracts/SettlementSmartContract.js +310 -0
- package/dist/settlement/contracts/SettlementSmartContract.js.map +1 -0
- package/dist/settlement/contracts/TokenBridgeTree.d.ts +228 -0
- package/dist/settlement/contracts/TokenBridgeTree.d.ts.map +1 -0
- package/dist/settlement/contracts/TokenBridgeTree.js +60 -0
- package/dist/settlement/contracts/TokenBridgeTree.js.map +1 -0
- package/dist/settlement/contracts/authorizations/ContractAuthorization.d.ts +10 -0
- package/dist/settlement/contracts/authorizations/ContractAuthorization.d.ts.map +1 -0
- package/dist/settlement/contracts/authorizations/ContractAuthorization.js +2 -0
- package/dist/settlement/contracts/authorizations/ContractAuthorization.js.map +1 -0
- package/dist/settlement/contracts/authorizations/TokenBridgeDeploymentAuth.d.ts +85 -0
- package/dist/settlement/contracts/authorizations/TokenBridgeDeploymentAuth.d.ts.map +1 -0
- package/dist/settlement/contracts/authorizations/TokenBridgeDeploymentAuth.js +11 -0
- package/dist/settlement/contracts/authorizations/TokenBridgeDeploymentAuth.js.map +1 -0
- package/dist/settlement/contracts/authorizations/UpdateMessagesHashAuth.d.ts +79 -0
- package/dist/settlement/contracts/authorizations/UpdateMessagesHashAuth.d.ts.map +1 -0
- package/dist/settlement/contracts/authorizations/UpdateMessagesHashAuth.js +11 -0
- package/dist/settlement/contracts/authorizations/UpdateMessagesHashAuth.js.map +1 -0
- package/dist/settlement/messages/Deposit.d.ts +77 -0
- package/dist/settlement/messages/Deposit.d.ts.map +1 -0
- package/dist/settlement/messages/Deposit.js +8 -0
- package/dist/settlement/messages/Deposit.js.map +1 -0
- package/dist/settlement/messages/OutgoingMessage.d.ts +67 -0
- package/dist/settlement/messages/OutgoingMessage.d.ts.map +1 -0
- package/dist/settlement/messages/OutgoingMessage.js +7 -0
- package/dist/settlement/messages/OutgoingMessage.js.map +1 -0
- package/dist/settlement/messages/OutgoingMessageArgument.d.ts +462 -0
- package/dist/settlement/messages/OutgoingMessageArgument.d.ts.map +1 -0
- package/dist/settlement/messages/OutgoingMessageArgument.js +40 -0
- package/dist/settlement/messages/OutgoingMessageArgument.js.map +1 -0
- package/dist/settlement/messages/Withdrawal.d.ts +2 -0
- package/dist/settlement/messages/Withdrawal.d.ts.map +1 -0
- package/dist/settlement/messages/Withdrawal.js +3 -0
- package/dist/settlement/messages/Withdrawal.js.map +1 -0
- package/dist/settlement/modularity/OutgoingMessageProcessor.d.ts +25 -0
- package/dist/settlement/modularity/OutgoingMessageProcessor.d.ts.map +1 -0
- package/dist/settlement/modularity/OutgoingMessageProcessor.js +30 -0
- package/dist/settlement/modularity/OutgoingMessageProcessor.js.map +1 -0
- package/dist/settlement/modularity/ProvableSettlementHook.d.ts +26 -0
- package/dist/settlement/modularity/ProvableSettlementHook.d.ts.map +1 -0
- package/dist/settlement/modularity/ProvableSettlementHook.js +4 -0
- package/dist/settlement/modularity/ProvableSettlementHook.js.map +1 -0
- package/dist/settlement/modularity/types.d.ts +8 -0
- package/dist/settlement/modularity/types.d.ts.map +1 -0
- package/dist/settlement/modularity/types.js +2 -0
- package/dist/settlement/modularity/types.js.map +1 -0
- package/dist/settlement/modules/NetworkStateSettlementModule.d.ts +11 -0
- package/dist/settlement/modules/NetworkStateSettlementModule.d.ts.map +1 -0
- package/dist/settlement/modules/NetworkStateSettlementModule.js +15 -0
- package/dist/settlement/modules/NetworkStateSettlementModule.js.map +1 -0
- package/dist/state/SimpleAsyncStateService.d.ts +6 -0
- package/dist/state/SimpleAsyncStateService.d.ts.map +1 -0
- package/dist/state/SimpleAsyncStateService.js +2 -0
- package/dist/state/SimpleAsyncStateService.js.map +1 -0
- package/dist/state/State.d.ts +68 -0
- package/dist/state/State.d.ts.map +1 -0
- package/dist/state/State.js +131 -0
- package/dist/state/State.js.map +1 -0
- package/dist/state/StateMap.d.ts +37 -0
- package/dist/state/StateMap.d.ts.map +1 -0
- package/dist/state/StateMap.js +56 -0
- package/dist/state/StateMap.js.map +1 -0
- package/dist/state/StateService.d.ts +6 -0
- package/dist/state/StateService.d.ts.map +1 -0
- package/dist/state/StateService.js +2 -0
- package/dist/state/StateService.js.map +1 -0
- package/dist/state/StateServiceProvider.d.ts +8 -0
- package/dist/state/StateServiceProvider.d.ts.map +1 -0
- package/dist/state/StateServiceProvider.js +37 -0
- package/dist/state/StateServiceProvider.js.map +1 -0
- package/dist/state/assert/assert.d.ts +12 -0
- package/dist/state/assert/assert.d.ts.map +1 -0
- package/dist/state/assert/assert.js +33 -0
- package/dist/state/assert/assert.js.map +1 -0
- package/dist/state/context/RuntimeMethodExecutionContext.d.ts +193 -0
- package/dist/state/context/RuntimeMethodExecutionContext.d.ts.map +1 -0
- package/dist/state/context/RuntimeMethodExecutionContext.js +138 -0
- package/dist/state/context/RuntimeMethodExecutionContext.js.map +1 -0
- package/dist/state/context/TransitionMethodExecutionContext.d.ts +23 -0
- package/dist/state/context/TransitionMethodExecutionContext.d.ts.map +1 -0
- package/dist/state/context/TransitionMethodExecutionContext.js +6 -0
- package/dist/state/context/TransitionMethodExecutionContext.js.map +1 -0
- package/dist/state/protocol/ProtocolState.d.ts +13 -0
- package/dist/state/protocol/ProtocolState.d.ts.map +1 -0
- package/dist/state/protocol/ProtocolState.js +58 -0
- package/dist/state/protocol/ProtocolState.js.map +1 -0
- package/dist/utils/FieldOptions.d.ts +62 -0
- package/dist/utils/FieldOptions.d.ts.map +1 -0
- package/dist/utils/FieldOptions.js +13 -0
- package/dist/utils/FieldOptions.js.map +1 -0
- package/dist/utils/MinaPrefixedProvableHashList.d.ts +19 -0
- package/dist/utils/MinaPrefixedProvableHashList.d.ts.map +1 -0
- package/dist/utils/MinaPrefixedProvableHashList.js +46 -0
- package/dist/utils/MinaPrefixedProvableHashList.js.map +1 -0
- package/dist/utils/PrefixedProvableHashList.d.ts +2 -2
- package/dist/utils/PrefixedProvableHashList.d.ts.map +1 -1
- package/dist/utils/PrefixedProvableHashList.js +2 -1
- package/dist/utils/PrefixedProvableHashList.js.map +1 -0
- package/dist/utils/ProvableHashList.d.ts +23 -4
- package/dist/utils/ProvableHashList.d.ts.map +1 -1
- package/dist/utils/ProvableHashList.js +38 -2
- package/dist/utils/ProvableHashList.js.map +1 -0
- package/dist/utils/ProvableReductionHashList.d.ts +18 -0
- package/dist/utils/ProvableReductionHashList.d.ts.map +1 -0
- package/dist/utils/ProvableReductionHashList.js +54 -0
- package/dist/utils/ProvableReductionHashList.js.map +1 -0
- package/dist/utils/StateTransitionReductionList.d.ts +11 -0
- package/dist/utils/StateTransitionReductionList.d.ts.map +1 -0
- package/dist/utils/StateTransitionReductionList.js +61 -0
- package/dist/utils/StateTransitionReductionList.js.map +1 -0
- package/dist/utils/utils.d.ts +20 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +51 -0
- package/dist/utils/utils.js.map +1 -0
- package/jest.config.cjs +12 -1
- package/package.json +11 -9
- package/src/hashing/mina-prefixes.ts +10 -0
- package/src/hashing/protokit-prefixes.ts +37 -0
- package/src/hooks/AccountStateHook.ts +57 -0
- package/src/hooks/BlockHeightHook.ts +17 -0
- package/src/hooks/LastStateRootBlockHook.ts +25 -0
- package/src/hooks/NoopBlockHook.ts +24 -0
- package/src/hooks/NoopSettlementHook.ts +20 -0
- package/src/hooks/NoopTransactionHook.ts +13 -0
- package/src/index.ts +51 -9
- package/src/model/AppliedStateTransitionBatch.ts +16 -0
- package/src/model/MethodPublicOutput.ts +3 -1
- package/src/model/Option.ts +99 -60
- package/src/model/Path.ts +9 -5
- package/src/model/RuntimeLike.ts +12 -0
- package/src/model/StateTransition.ts +25 -3
- package/src/model/StateTransitionProvableBatch.ts +117 -14
- package/src/model/Transaction.ts +3 -1
- package/src/model/network/NetworkState.ts +21 -3
- package/src/model/transaction/RuntimeTransaction.ts +90 -15
- package/src/model/transaction/SignedTransaction.ts +47 -0
- package/src/model/transaction/ValueOption.ts +28 -0
- package/src/protocol/Protocol.ts +166 -74
- package/src/protocol/ProtocolEnvironment.ts +10 -0
- package/src/protocol/ProtocolModule.ts +16 -16
- package/src/protocol/ProvableBlockHook.ts +68 -0
- package/src/protocol/ProvableTransactionHook.ts +77 -0
- package/src/protocol/TransitioningProtocolModule.ts +12 -0
- package/src/prover/accumulators/AppliedBatchHashList.ts +32 -0
- package/src/prover/accumulators/StateTransitionReductionList.ts +92 -0
- package/src/prover/accumulators/TransactionHashList.ts +9 -0
- package/src/prover/accumulators/WitnessedRootHashList.ts +61 -0
- package/src/prover/block/BlockProvable.ts +188 -15
- package/src/prover/block/BlockProver.ts +979 -143
- package/src/prover/block/accummulators/BlockHashMerkleTree.ts +24 -0
- package/src/prover/block/accummulators/RuntimeVerificationKeyTree.ts +24 -0
- package/src/prover/block/services/RuntimeVerificationKeyRootService.ts +20 -0
- package/src/prover/statetransition/StateTransitionProvable.ts +26 -19
- package/src/prover/statetransition/StateTransitionProver.ts +338 -130
- package/src/settlement/ContractModule.ts +31 -0
- package/src/settlement/SettlementContractModule.ts +145 -0
- package/src/settlement/contracts/BridgeContract.ts +366 -0
- package/src/settlement/contracts/BridgeContractProtocolModule.ts +48 -0
- package/src/settlement/contracts/DispatchContractProtocolModule.ts +75 -0
- package/src/settlement/contracts/DispatchSmartContract.ts +325 -0
- package/src/settlement/contracts/SettlementContractProtocolModule.ts +113 -0
- package/src/settlement/contracts/SettlementSmartContract.ts +502 -0
- package/src/settlement/contracts/TokenBridgeTree.ts +73 -0
- package/src/settlement/contracts/authorizations/ContractAuthorization.ts +11 -0
- package/src/settlement/contracts/authorizations/TokenBridgeDeploymentAuth.ts +16 -0
- package/src/settlement/contracts/authorizations/UpdateMessagesHashAuth.ts +16 -0
- package/src/settlement/messages/Deposit.ts +7 -0
- package/src/settlement/messages/OutgoingMessage.ts +17 -0
- package/src/settlement/messages/OutgoingMessageArgument.ts +53 -0
- package/src/settlement/modularity/OutgoingMessageProcessor.ts +65 -0
- package/src/settlement/modularity/ProvableSettlementHook.ts +36 -0
- package/src/settlement/modularity/types.ts +22 -0
- package/src/settlement/modules/NetworkStateSettlementModule.ts +42 -0
- package/src/state/State.ts +177 -0
- package/src/state/StateMap.ts +73 -0
- package/src/state/StateService.ts +6 -0
- package/src/state/StateServiceProvider.ts +37 -0
- package/src/state/assert/assert.ts +38 -0
- package/src/state/context/RuntimeMethodExecutionContext.ts +181 -0
- package/src/state/context/TransitionMethodExecutionContext.ts +26 -0
- package/src/state/protocol/ProtocolState.ts +98 -0
- package/src/utils/FieldOptions.ts +13 -0
- package/src/utils/MinaPrefixedProvableHashList.ts +66 -0
- package/src/utils/PrefixedProvableHashList.ts +2 -2
- package/src/utils/ProvableHashList.ts +78 -3
- package/src/utils/ProvableReductionHashList.ts +77 -0
- package/src/utils/utils.ts +44 -55
- package/test/BlockProver.test.ts +161 -74
- package/test/Protocol.test.ts +20 -10
- package/test/State.test.ts +45 -0
- package/test/StateTransition.test.ts +57 -65
- package/test/TestingProtocol.ts +56 -0
- package/test/compiling/types.ts +28 -0
- package/test/model/Option.test.ts +72 -0
- package/test/model/StateTransitionProvableBatch.test.ts +137 -0
- package/test/modularity/types.ts +35 -0
- package/test/prover/block/BlockProver.test.ts +18 -0
- package/test/prover/statetransition/StateTransitionProver.test.ts +261 -0
- package/test/state/assert/assert.test.ts +56 -0
- package/test/tsconfig.json +7 -0
- package/test/utils/ProvableHashList.test.ts +44 -0
- package/test/utils/ProvableReductionHashList.test.ts +117 -0
- package/test/utils.test.ts +27 -0
- package/dist/config/ConfigurableModule.d.ts +0 -18
- package/dist/config/ConfigurableModule.d.ts.map +0 -1
- package/dist/config/ConfigurableModule.js +0 -20
- package/dist/config/ConfigurationAggregator.d.ts +0 -10
- package/dist/config/ConfigurationAggregator.d.ts.map +0 -1
- package/dist/config/ConfigurationAggregator.js +0 -35
- package/dist/config/ConfigurationReceiver.d.ts +0 -25
- package/dist/config/ConfigurationReceiver.d.ts.map +0 -1
- package/dist/config/ConfigurationReceiver.js +0 -36
- package/dist/config/ModuleContainer.d.ts +0 -44
- package/dist/config/ModuleContainer.d.ts.map +0 -1
- package/dist/config/ModuleContainer.js +0 -89
- package/dist/config/types.d.ts +0 -2
- package/dist/config/types.d.ts.map +0 -1
- package/dist/config/types.js +0 -1
- package/dist/model/MethodPublicInput.d.ts +0 -51
- package/dist/model/MethodPublicInput.d.ts.map +0 -1
- package/dist/model/MethodPublicInput.js +0 -11
- package/dist/model/transaction/ProtocolTransaction.d.ts +0 -70
- package/dist/model/transaction/ProtocolTransaction.d.ts.map +0 -1
- package/dist/model/transaction/ProtocolTransaction.js +0 -18
- package/dist/prover/block/BlockScopedModule.d.ts +0 -3
- package/dist/prover/block/BlockScopedModule.d.ts.map +0 -1
- package/dist/prover/block/BlockScopedModule.js +0 -6
- package/dist/prover/statetransition/StateTransitionWitnessProvider.d.ts +0 -16
- package/dist/prover/statetransition/StateTransitionWitnessProvider.d.ts.map +0 -1
- package/dist/prover/statetransition/StateTransitionWitnessProviderReference.d.ts +0 -7
- package/dist/prover/statetransition/StateTransitionWitnessProviderReference.d.ts.map +0 -1
- package/dist/src/model/Option.d.ts +0 -158
- package/dist/src/model/Option.d.ts.map +0 -1
- package/dist/src/model/Option.js +0 -53
- package/dist/src/model/Path.d.ts +0 -35
- package/dist/src/model/Path.d.ts.map +0 -1
- package/dist/src/model/Path.js +0 -51
- package/dist/src/model/StateTransition.d.ts +0 -201
- package/dist/src/model/StateTransition.d.ts.map +0 -1
- package/dist/src/model/StateTransition.js +0 -43
- package/dist/src/utils/PrefixedHashList.d.ts +0 -15
- package/dist/src/utils/PrefixedHashList.d.ts.map +0 -1
- package/dist/src/utils/PrefixedHashList.js +0 -28
- package/dist/src/utils/ProvableHashList.d.ts +0 -30
- package/dist/src/utils/ProvableHashList.d.ts.map +0 -1
- package/dist/src/utils/ProvableHashList.js +0 -43
- package/dist/utils/PrefixedHashList.d.ts +0 -14
- package/dist/utils/PrefixedHashList.d.ts.map +0 -1
- package/dist/utils/PrefixedHashList.js +0 -12
- package/dist/utils/Utils.d.ts +0 -17
- package/dist/utils/Utils.d.ts.map +0 -1
- package/dist/utils/Utils.js +0 -64
- package/dist/utils/merkletree/InMemoryMerkleTreeStorage.d.ts +0 -25
- package/dist/utils/merkletree/InMemoryMerkleTreeStorage.d.ts.map +0 -1
- package/dist/utils/merkletree/InMemoryMerkleTreeStorage.js +0 -77
- package/dist/utils/merkletree/MemoryMerkleTreeStorage.d.ts +0 -26
- package/dist/utils/merkletree/MemoryMerkleTreeStorage.d.ts.map +0 -1
- package/dist/utils/merkletree/MemoryMerkleTreeStorage.js +0 -79
- package/dist/utils/merkletree/MerkleTreeStore.d.ts +0 -11
- package/dist/utils/merkletree/MerkleTreeStore.d.ts.map +0 -1
- package/dist/utils/merkletree/MerkleTreeStore.js +0 -1
- package/dist/utils/merkletree/RollupMerkleTree.d.ts +0 -130
- package/dist/utils/merkletree/RollupMerkleTree.d.ts.map +0 -1
- package/dist/utils/merkletree/RollupMerkleTree.js +0 -244
- package/src/model/Option.test.ts +0 -21
- package/src/model/transaction/ProtocolTransaction.ts +0 -25
- package/src/prover/statetransition/StateTransitionWitnessProvider.ts +0 -24
- package/src/prover/statetransition/StateTransitionWitnessProviderReference.ts +0 -17
- package/src/utils/merkletree/InMemoryMerkleTreeStorage.ts +0 -106
- package/src/utils/merkletree/MerkleTreeStore.ts +0 -15
- package/src/utils/merkletree/RollupMerkleTree.ts +0 -250
- package/src/utils/merkletree/VirtualMerkleTreeStore.ts +0 -21
- package/tsconfig.test.json +0 -9
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type Preset<Config> = Config | ((...args: any[]) => Config);
|
|
2
|
-
export type Presets<Config> = Record<string, Preset<Config>>;
|
|
3
|
-
export interface Configurable<Config> {
|
|
4
|
-
config: Config;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Used by various module sub-types that may need to be configured
|
|
8
|
-
*/
|
|
9
|
-
export declare class ConfigurableModule<Config> implements Configurable<Config> {
|
|
10
|
-
protected currentConfig: Config | undefined;
|
|
11
|
-
constructor(...args: any[]);
|
|
12
|
-
get config(): Config;
|
|
13
|
-
set config(config: Config);
|
|
14
|
-
}
|
|
15
|
-
export interface StaticConfigurableModule<Config> {
|
|
16
|
-
presets: Presets<Config>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ConfigurableModule.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurableModule.d.ts","sourceRoot":"","sources":["../../src/config/ConfigurableModule.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,MAAM,CAAC,MAAM,IAAI,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,MAAM,CAAC,CAAC;AACnE,MAAM,MAAM,OAAO,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;AAG7D,MAAM,WAAW,YAAY,CAAC,MAAM;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,qBAAa,kBAAkB,CAAC,MAAM,CAAE,YAAW,YAAY,CAAC,MAAM,CAAC;IACrE,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;gBAIzB,GAAG,IAAI,EAAE,GAAG,EAAE;IAEjC,IAAW,MAAM,IAAI,MAAM,CAK1B;IAED,IAAW,MAAM,CAAC,MAAM,EAAE,MAAM,EAE/B;CACF;AAGD,MAAM,WAAW,wBAAwB,CAAC,MAAM;IAC9C,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC1B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const errors = {
|
|
2
|
-
configNotSet: (moduleName) => new Error(`Trying to retrieve config of ${moduleName}, which was not yet set`),
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Used by various module sub-types that may need to be configured
|
|
6
|
-
*/
|
|
7
|
-
export class ConfigurableModule {
|
|
8
|
-
// eslint-disable-next-line max-len
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-useless-constructor, @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function
|
|
10
|
-
constructor(...args) { }
|
|
11
|
-
get config() {
|
|
12
|
-
if (this.currentConfig === undefined) {
|
|
13
|
-
throw errors.configNotSet(this.constructor.name);
|
|
14
|
-
}
|
|
15
|
-
return this.currentConfig;
|
|
16
|
-
}
|
|
17
|
-
set config(config) {
|
|
18
|
-
this.currentConfig = config;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ComponentConfig, Components, RemoveUndefinedKeys, UninitializedComponentConfig } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* In this context, a "Component" is just a way of generalizing Modules,
|
|
4
|
-
* because they don't have to be modules, they can be any configurable unit
|
|
5
|
-
*/
|
|
6
|
-
export declare abstract class ConfigurationAggregator<Comps extends Components> {
|
|
7
|
-
protected applyConfig(modules: Comps, currentConfig: UninitializedComponentConfig<ComponentConfig<Comps>>, config: RemoveUndefinedKeys<ComponentConfig<Comps>>): ComponentConfig<Comps>;
|
|
8
|
-
abstract configure(config: RemoveUndefinedKeys<ComponentConfig<Comps>>): void;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=ConfigurationAggregator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationAggregator.d.ts","sourceRoot":"","sources":["../../src/config/ConfigurationAggregator.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,4BAA4B,EAC7B,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,8BAAsB,uBAAuB,CAAC,KAAK,SAAS,UAAU;IACpE,SAAS,CAAC,WAAW,CACnB,OAAO,EAAE,KAAK,EACd,aAAa,EAAE,4BAA4B,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,EACnE,MAAM,EAAE,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,GAClD,eAAe,CAAC,KAAK,CAAC;aAgCT,SAAS,CACvB,MAAM,EAAE,mBAAmB,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,GAClD,IAAI;CACR"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any,guard-for-in,@typescript-eslint/no-unsafe-member-access,max-len,@typescript-eslint/no-unsafe-assignment,@typescript-eslint/consistent-type-assertions */
|
|
2
|
-
import merge from "lodash/merge";
|
|
3
|
-
/**
|
|
4
|
-
* In this context, a "Component" is just a way of generalizing Modules,
|
|
5
|
-
* because they don't have to be modules, they can be any configurable unit
|
|
6
|
-
*/
|
|
7
|
-
export class ConfigurationAggregator {
|
|
8
|
-
applyConfig(modules, currentConfig, config) {
|
|
9
|
-
const nextConfig = {};
|
|
10
|
-
for (const key in config) {
|
|
11
|
-
// Set config to module
|
|
12
|
-
if (currentConfig[key] === undefined) {
|
|
13
|
-
// Initialize config with merge between config and defaultConfig
|
|
14
|
-
// eslint-disable-next-line prefer-destructuring,putout/putout
|
|
15
|
-
const defaultConfig = modules[key].defaultConfig;
|
|
16
|
-
const newConfig = config[key];
|
|
17
|
-
for (const configKey in newConfig) {
|
|
18
|
-
defaultConfig[configKey] = newConfig[configKey];
|
|
19
|
-
}
|
|
20
|
-
// The result of that is always a valid Required<Config> since FlipOptional<Config> requires the exact opposite of Config
|
|
21
|
-
modules[key].config = defaultConfig;
|
|
22
|
-
nextConfig[key] = defaultConfig;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
// Append/overwrite to existing config
|
|
26
|
-
const newConfig = config[key];
|
|
27
|
-
const moduleConfig = currentConfig[key];
|
|
28
|
-
merge(moduleConfig, newConfig);
|
|
29
|
-
modules[key].config = moduleConfig;
|
|
30
|
-
nextConfig[key] = moduleConfig;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return nextConfig;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { FlipOptional } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Configs:
|
|
4
|
-
*
|
|
5
|
-
* A property that accepts undefined, is an optional argument.
|
|
6
|
-
* That means that you will have to provide it via defaultConfig() and it will
|
|
7
|
-
* be non-undefined via this.config. This is used by devs to indicate
|
|
8
|
-
* configurability but not necessary explicit definition.
|
|
9
|
-
* I.e. when the default arguments will work most of the time
|
|
10
|
-
*
|
|
11
|
-
* If devs want a property that can be undefined, they should use null instead
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
export declare abstract class ConfigurationReceiver<Config> {
|
|
15
|
-
private currentConfig?;
|
|
16
|
-
/**
|
|
17
|
-
* Retrieves the configured config object.
|
|
18
|
-
* This is only available in instance methods like start(), using this in
|
|
19
|
-
* the constructor will throw an Exception
|
|
20
|
-
*/
|
|
21
|
-
get config(): Required<Config>;
|
|
22
|
-
set config(config: Required<Config>);
|
|
23
|
-
abstract get defaultConfig(): FlipOptional<Config>;
|
|
24
|
-
}
|
|
25
|
-
//# sourceMappingURL=ConfigurationReceiver.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationReceiver.d.ts","sourceRoot":"","sources":["../../src/config/ConfigurationReceiver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAO5C;;;;;;;;;;;GAWG;AACH,8BAAsB,qBAAqB,CAAC,MAAM;IAChD,OAAO,CAAC,aAAa,CAAC,CAA+B;IAErD;;;;OAIG;IACH,IAAW,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,CAOpC;IAED,IAAW,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAEzC;IAED,aAAoB,aAAa,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC;CAC3D"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const errors = {
|
|
2
|
-
configNotSet: (name) => new Error(`RuntimeModule (${name}) config has not been set!`),
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* Configs:
|
|
6
|
-
*
|
|
7
|
-
* A property that accepts undefined, is an optional argument.
|
|
8
|
-
* That means that you will have to provide it via defaultConfig() and it will
|
|
9
|
-
* be non-undefined via this.config. This is used by devs to indicate
|
|
10
|
-
* configurability but not necessary explicit definition.
|
|
11
|
-
* I.e. when the default arguments will work most of the time
|
|
12
|
-
*
|
|
13
|
-
* If devs want a property that can be undefined, they should use null instead
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
export class ConfigurationReceiver {
|
|
17
|
-
constructor() {
|
|
18
|
-
this.currentConfig = undefined;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves the configured config object.
|
|
22
|
-
* This is only available in instance methods like start(), using this in
|
|
23
|
-
* the constructor will throw an Exception
|
|
24
|
-
*/
|
|
25
|
-
get config() {
|
|
26
|
-
if (this.currentConfig === undefined) {
|
|
27
|
-
// eslint-disable-next-line no-warning-comments
|
|
28
|
-
// TODO Check properly, Config could also be void
|
|
29
|
-
throw errors.configNotSet(this.constructor.name);
|
|
30
|
-
}
|
|
31
|
-
return this.currentConfig;
|
|
32
|
-
}
|
|
33
|
-
set config(config) {
|
|
34
|
-
this.currentConfig = config;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { Frequency, InjectionToken } from "tsyringe";
|
|
2
|
-
import { TypedClassConstructor } from "../utils/utils";
|
|
3
|
-
import { Configurable, ConfigurableModule } from "./ConfigurableModule";
|
|
4
|
-
export declare const errors: {
|
|
5
|
-
configNotSet: (moduleName: string) => Error;
|
|
6
|
-
configNotSetInContainer: (moduleName: string) => Error;
|
|
7
|
-
onlyStringModuleNames: (moduleName: NonNullable<unknown>) => Error;
|
|
8
|
-
unableToDecorateModule: (moduleName: InjectionToken<unknown>) => Error;
|
|
9
|
-
nonModuleDependecy: (runtimeModuleName: string) => Error;
|
|
10
|
-
unknownDependency: (runtimeModuleName: string, name: string) => Error;
|
|
11
|
-
};
|
|
12
|
-
export type BaseModuleType = TypedClassConstructor<Configurable<unknown>>;
|
|
13
|
-
export interface ModulesRecord<ModuleType extends BaseModuleType = BaseModuleType> {
|
|
14
|
-
[name: string]: ModuleType;
|
|
15
|
-
}
|
|
16
|
-
export type ModulesConfig<Modules extends ModulesRecord> = {
|
|
17
|
-
[ConfigKey in keyof Modules]: InstanceType<Modules[ConfigKey]>["config"];
|
|
18
|
-
};
|
|
19
|
-
export declare abstract class ModuleContainer<Modules extends ModulesRecord, Config extends ModulesConfig<Modules>> {
|
|
20
|
-
definition: {
|
|
21
|
-
modules: Modules;
|
|
22
|
-
config?: Config;
|
|
23
|
-
};
|
|
24
|
-
static moduleDecorationFrequency: Frequency;
|
|
25
|
-
container: import("tsyringe").DependencyContainer;
|
|
26
|
-
constructor(definition: {
|
|
27
|
-
modules: Modules;
|
|
28
|
-
config?: Config;
|
|
29
|
-
});
|
|
30
|
-
get moduleNames(): string[];
|
|
31
|
-
validateModule<ModuleName extends keyof Modules>(moduleName: ModuleName | string, containedModule: ConfigurableModule<unknown>): void;
|
|
32
|
-
registerModules(modules: Modules): void;
|
|
33
|
-
registerValue<Value>(modules: Record<string, Value>): void;
|
|
34
|
-
configure(config: Config): void;
|
|
35
|
-
resolve<ModuleName extends keyof Modules>(moduleName: ModuleName): InstanceType<Modules[ModuleName]>;
|
|
36
|
-
moduleNameToString<ModuleName extends keyof Modules>(moduleName: ModuleName | string): string;
|
|
37
|
-
/**
|
|
38
|
-
* Override this in the child class to provide custom
|
|
39
|
-
* features or module checks
|
|
40
|
-
*/
|
|
41
|
-
decorateModule<ModuleName extends keyof Modules>(moduleName: ModuleName | string, containedModule: InstanceType<Modules[ModuleName]>): void;
|
|
42
|
-
onAfterModuleResolution<ModuleName extends keyof Modules>(moduleName: ModuleName | string): void;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=ModuleContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ModuleContainer.d.ts","sourceRoot":"","sources":["../../src/config/ModuleContainer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,SAAS,EAAE,cAAc,EAAa,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAExE,eAAO,MAAM,MAAM;+BACU,MAAM;0CAKK,MAAM;wCAKR,YAAY,OAAO,CAAC;yCAMnB,eAAe,OAAO,CAAC;4CAIpB,MAAM;2CAIP,MAAM,QAAQ,MAAM;CAM5D,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,qBAAqB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;AAC1E,MAAM,WAAW,aAAa,CAC5B,UAAU,SAAS,cAAc,GAAG,cAAc;IAElD,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC;CAC5B;AAED,MAAM,MAAM,aAAa,CAAC,OAAO,SAAS,aAAa,IAAI;KACxD,SAAS,IAAI,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC;CACzE,CAAC;AAEF,8BAAsB,eAAe,CACnC,OAAO,SAAS,aAAa,EAC7B,MAAM,SAAS,aAAa,CAAC,OAAO,CAAC;IAO5B,UAAU,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IARH,OAAc,yBAAyB,EAAE,SAAS,CAAU;IAErD,SAAS,yCAAoC;gBAG3C,UAAU,EAAE;QACjB,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB;IAKH,IAAW,WAAW,aAErB;IAEM,cAAc,CAAC,UAAU,SAAS,MAAM,OAAO,EACpD,UAAU,EAAE,UAAU,GAAG,MAAM,EAC/B,eAAe,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAC3C,IAAI;IAsBA,eAAe,CAAC,OAAO,EAAE,OAAO;IAahC,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAMnD,SAAS,CAAC,MAAM,EAAE,MAAM;IAIxB,OAAO,CAAC,UAAU,SAAS,MAAM,OAAO,EAC7C,UAAU,EAAE,UAAU,GACrB,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAI7B,kBAAkB,CAAC,UAAU,SAAS,MAAM,OAAO,EACxD,UAAU,EAAE,UAAU,GAAG,MAAM,GAC9B,MAAM;IAQT;;;OAGG;IACI,cAAc,CAAC,UAAU,SAAS,MAAM,OAAO,EACpD,UAAU,EAAE,UAAU,GAAG,MAAM,EAC/B,eAAe,EAAE,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAa7C,uBAAuB,CAAC,UAAU,SAAS,MAAM,OAAO,EAC7D,UAAU,EAAE,UAAU,GAAG,MAAM;CAclC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { container, Lifecycle } from "tsyringe";
|
|
2
|
-
export const errors = {
|
|
3
|
-
configNotSet: (moduleName) => new Error(`Trying to retrieve config of ${moduleName}, which was not yet set`),
|
|
4
|
-
configNotSetInContainer: (moduleName) => new Error(`Trying to set config of ${moduleName}, but it was not yet set in the module container`),
|
|
5
|
-
onlyStringModuleNames: (moduleName) => new Error(
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
7
|
-
`Only string module names, using ${typeof moduleName} instead: ${moduleName.toString()}`),
|
|
8
|
-
unableToDecorateModule: (moduleName) =>
|
|
9
|
-
// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
10
|
-
new Error(`Unable to decorate module ${moduleName.toString()}`),
|
|
11
|
-
nonModuleDependecy: (runtimeModuleName) => new Error(`
|
|
12
|
-
Unable to register module: ${runtimeModuleName}, attempting to inject a non-module dependency`),
|
|
13
|
-
unknownDependency: (runtimeModuleName, name) => new Error(`Unable to register module: ${runtimeModuleName},
|
|
14
|
-
attempting to inject a dependency that is not registred
|
|
15
|
-
as a runtime module for this chain: ${name}`),
|
|
16
|
-
};
|
|
17
|
-
export class ModuleContainer {
|
|
18
|
-
constructor(definition) {
|
|
19
|
-
this.definition = definition;
|
|
20
|
-
this.container = container.createChildContainer();
|
|
21
|
-
this.registerModules(definition.modules);
|
|
22
|
-
}
|
|
23
|
-
get moduleNames() {
|
|
24
|
-
return Object.keys(this.definition.modules);
|
|
25
|
-
}
|
|
26
|
-
validateModule(moduleName, containedModule) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
28
|
-
const dependencies = Reflect.getMetadata("design:paramtypes", containedModule);
|
|
29
|
-
dependencies?.forEach((dependency) => {
|
|
30
|
-
const name = typeof dependency === "string" ? dependency : dependency.name;
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
32
|
-
if (!name) {
|
|
33
|
-
throw errors.nonModuleDependecy(this.moduleNameToString(moduleName));
|
|
34
|
-
}
|
|
35
|
-
if (!this.moduleNames.includes(name)) {
|
|
36
|
-
throw errors.unknownDependency(this.moduleNameToString(moduleName), name);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
registerModules(modules) {
|
|
41
|
-
for (const moduleName in modules) {
|
|
42
|
-
if (Object.prototype.hasOwnProperty.call(modules, moduleName)) {
|
|
43
|
-
this.container.register(moduleName, { useClass: modules[moduleName] }, { lifecycle: Lifecycle.ContainerScoped });
|
|
44
|
-
this.onAfterModuleResolution(moduleName);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
registerValue(modules) {
|
|
49
|
-
Object.entries(modules).forEach(([moduleName, useValue]) => {
|
|
50
|
-
this.container.register(moduleName, { useValue });
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
configure(config) {
|
|
54
|
-
this.definition.config = config;
|
|
55
|
-
}
|
|
56
|
-
resolve(moduleName) {
|
|
57
|
-
return this.container.resolve(this.moduleNameToString(moduleName));
|
|
58
|
-
}
|
|
59
|
-
moduleNameToString(moduleName) {
|
|
60
|
-
if (typeof moduleName !== "string") {
|
|
61
|
-
throw errors.onlyStringModuleNames(moduleName);
|
|
62
|
-
}
|
|
63
|
-
return moduleName;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Override this in the child class to provide custom
|
|
67
|
-
* features or module checks
|
|
68
|
-
*/
|
|
69
|
-
decorateModule(moduleName, containedModule) {
|
|
70
|
-
const moduleNameString = this.moduleNameToString(moduleName);
|
|
71
|
-
const config = this.definition.config?.[moduleNameString];
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
|
|
73
|
-
if (!config) {
|
|
74
|
-
throw errors.configNotSetInContainer(moduleNameString);
|
|
75
|
-
}
|
|
76
|
-
containedModule.config = config;
|
|
77
|
-
}
|
|
78
|
-
onAfterModuleResolution(moduleName) {
|
|
79
|
-
this.container.afterResolution(
|
|
80
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
81
|
-
moduleName, (containedModuleName, containedModule) => {
|
|
82
|
-
if (Array.isArray(containedModule)) {
|
|
83
|
-
throw errors.unableToDecorateModule(containedModuleName);
|
|
84
|
-
}
|
|
85
|
-
this.decorateModule(moduleName, containedModule);
|
|
86
|
-
}, { frequency: ModuleContainer.moduleDecorationFrequency });
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
ModuleContainer.moduleDecorationFrequency = "Once";
|
package/dist/config/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,CAAC,IAAI,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC"}
|
package/dist/config/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { Bool, Field } from "snarkyjs";
|
|
2
|
-
declare const MethodPublicInput_base: (new (value: {
|
|
3
|
-
stateTransitionsHash: Field;
|
|
4
|
-
status: Bool;
|
|
5
|
-
transactionHash: Field;
|
|
6
|
-
}) => {
|
|
7
|
-
stateTransitionsHash: Field;
|
|
8
|
-
status: Bool;
|
|
9
|
-
transactionHash: Field;
|
|
10
|
-
}) & {
|
|
11
|
-
_isStruct: true;
|
|
12
|
-
} & import("snarkyjs/dist/node/snarky").ProvablePure<{
|
|
13
|
-
stateTransitionsHash: Field;
|
|
14
|
-
status: Bool;
|
|
15
|
-
transactionHash: Field;
|
|
16
|
-
}> & {
|
|
17
|
-
toInput: (x: {
|
|
18
|
-
stateTransitionsHash: Field;
|
|
19
|
-
status: Bool;
|
|
20
|
-
transactionHash: Field;
|
|
21
|
-
}) => {
|
|
22
|
-
fields?: Field[] | undefined;
|
|
23
|
-
packed?: [Field, number][] | undefined;
|
|
24
|
-
};
|
|
25
|
-
toJSON: (x: {
|
|
26
|
-
stateTransitionsHash: Field;
|
|
27
|
-
status: Bool;
|
|
28
|
-
transactionHash: Field;
|
|
29
|
-
}) => {
|
|
30
|
-
stateTransitionsHash: string;
|
|
31
|
-
status: boolean;
|
|
32
|
-
transactionHash: string;
|
|
33
|
-
};
|
|
34
|
-
fromJSON: (x: {
|
|
35
|
-
stateTransitionsHash: string;
|
|
36
|
-
status: boolean;
|
|
37
|
-
transactionHash: string;
|
|
38
|
-
}) => {
|
|
39
|
-
stateTransitionsHash: Field;
|
|
40
|
-
status: Bool;
|
|
41
|
-
transactionHash: Field;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Public input used to link in-circuit execution with
|
|
46
|
-
* the proof's public input.
|
|
47
|
-
*/
|
|
48
|
-
export declare class MethodPublicInput extends MethodPublicInput_base {
|
|
49
|
-
}
|
|
50
|
-
export {};
|
|
51
|
-
//# sourceMappingURL=MethodPublicInput.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MethodPublicInput.d.ts","sourceRoot":"","sources":["../../src/model/MethodPublicInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAU,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/C;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,sBAIrC;CAAG"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Bool, Field, Struct } from "snarkyjs";
|
|
2
|
-
/**
|
|
3
|
-
* Public input used to link in-circuit execution with
|
|
4
|
-
* the proof's public input.
|
|
5
|
-
*/
|
|
6
|
-
export class MethodPublicInput extends Struct({
|
|
7
|
-
stateTransitionsHash: Field,
|
|
8
|
-
status: Bool,
|
|
9
|
-
transactionHash: Field,
|
|
10
|
-
}) {
|
|
11
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Bool, Field, PublicKey, Signature, UInt64 } from "snarkyjs";
|
|
2
|
-
declare const ProtocolTransaction_base: (new (value: {
|
|
3
|
-
methodId: import("snarkyjs/dist/node/lib/field").Field;
|
|
4
|
-
nonce: UInt64;
|
|
5
|
-
sender: PublicKey;
|
|
6
|
-
argsHash: import("snarkyjs/dist/node/lib/field").Field;
|
|
7
|
-
signature: Signature;
|
|
8
|
-
}) => {
|
|
9
|
-
methodId: import("snarkyjs/dist/node/lib/field").Field;
|
|
10
|
-
nonce: UInt64;
|
|
11
|
-
sender: PublicKey;
|
|
12
|
-
argsHash: import("snarkyjs/dist/node/lib/field").Field;
|
|
13
|
-
signature: Signature;
|
|
14
|
-
}) & {
|
|
15
|
-
_isStruct: true;
|
|
16
|
-
} & import("snarkyjs/dist/node/snarky").ProvablePure<{
|
|
17
|
-
methodId: import("snarkyjs/dist/node/lib/field").Field;
|
|
18
|
-
nonce: UInt64;
|
|
19
|
-
sender: PublicKey;
|
|
20
|
-
argsHash: import("snarkyjs/dist/node/lib/field").Field;
|
|
21
|
-
signature: Signature;
|
|
22
|
-
}> & {
|
|
23
|
-
toInput: (x: {
|
|
24
|
-
methodId: import("snarkyjs/dist/node/lib/field").Field;
|
|
25
|
-
nonce: UInt64;
|
|
26
|
-
sender: PublicKey;
|
|
27
|
-
argsHash: import("snarkyjs/dist/node/lib/field").Field;
|
|
28
|
-
signature: Signature;
|
|
29
|
-
}) => {
|
|
30
|
-
fields?: import("snarkyjs/dist/node/lib/field").Field[] | undefined;
|
|
31
|
-
packed?: [import("snarkyjs/dist/node/lib/field").Field, number][] | undefined;
|
|
32
|
-
};
|
|
33
|
-
toJSON: (x: {
|
|
34
|
-
methodId: import("snarkyjs/dist/node/lib/field").Field;
|
|
35
|
-
nonce: UInt64;
|
|
36
|
-
sender: PublicKey;
|
|
37
|
-
argsHash: import("snarkyjs/dist/node/lib/field").Field;
|
|
38
|
-
signature: Signature;
|
|
39
|
-
}) => {
|
|
40
|
-
methodId: string;
|
|
41
|
-
nonce: string;
|
|
42
|
-
sender: string;
|
|
43
|
-
argsHash: string;
|
|
44
|
-
signature: any;
|
|
45
|
-
};
|
|
46
|
-
fromJSON: (x: {
|
|
47
|
-
methodId: string;
|
|
48
|
-
nonce: string;
|
|
49
|
-
sender: string;
|
|
50
|
-
argsHash: string;
|
|
51
|
-
signature: any;
|
|
52
|
-
}) => {
|
|
53
|
-
methodId: import("snarkyjs/dist/node/lib/field").Field;
|
|
54
|
-
nonce: UInt64;
|
|
55
|
-
sender: PublicKey;
|
|
56
|
-
argsHash: import("snarkyjs/dist/node/lib/field").Field;
|
|
57
|
-
signature: Signature;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
export declare class ProtocolTransaction extends ProtocolTransaction_base {
|
|
61
|
-
static getSignatureData(args: {
|
|
62
|
-
methodId: Field;
|
|
63
|
-
nonce: UInt64;
|
|
64
|
-
argsHash: Field;
|
|
65
|
-
}): Field[];
|
|
66
|
-
getSignatureData(): Field[];
|
|
67
|
-
validateSignature(): Bool;
|
|
68
|
-
}
|
|
69
|
-
export {};
|
|
70
|
-
//# sourceMappingURL=ProtocolTransaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProtocolTransaction.d.ts","sourceRoot":"","sources":["../../../src/model/transaction/ProtocolTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAU,MAAM,EAAE,MAAM,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7E,qBAAa,mBAAoB,SAAQ,wBAMvC;WACc,gBAAgB,CAAC,IAAI,EAAE;QACnC,QAAQ,EAAE,KAAK,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,KAAK,CAAC;KACjB,GAAG,KAAK,EAAE;IAIJ,gBAAgB,IAAI,KAAK,EAAE;IAI3B,iBAAiB,IAAI,IAAI;CAGjC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Field, PublicKey, Signature, Struct, UInt64 } from "snarkyjs";
|
|
2
|
-
export class ProtocolTransaction extends Struct({
|
|
3
|
-
methodId: Field,
|
|
4
|
-
nonce: UInt64,
|
|
5
|
-
sender: PublicKey,
|
|
6
|
-
argsHash: Field,
|
|
7
|
-
signature: Signature,
|
|
8
|
-
}) {
|
|
9
|
-
static getSignatureData(args) {
|
|
10
|
-
return [args.methodId, ...args.nonce.toFields(), args.argsHash];
|
|
11
|
-
}
|
|
12
|
-
getSignatureData() {
|
|
13
|
-
return ProtocolTransaction.getSignatureData(this);
|
|
14
|
-
}
|
|
15
|
-
validateSignature() {
|
|
16
|
-
return this.signature.verify(this.sender, this.getSignatureData());
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BlockScopedModule.d.ts","sourceRoot":"","sources":["../../../src/prover/block/BlockScopedModule.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,OAAO,IAAI,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Field } from "snarkyjs";
|
|
2
|
-
import { RollupMerkleWitness } from "../../utils/merkletree/RollupMerkleTree.js";
|
|
3
|
-
/**
|
|
4
|
-
* Interface for providing merkle witnesses to the state-transition prover
|
|
5
|
-
*/
|
|
6
|
-
export interface StateTransitionWitnessProvider {
|
|
7
|
-
/**
|
|
8
|
-
* Provides the merkle witness corresponding to the given key
|
|
9
|
-
* @param key Merkle-tree key
|
|
10
|
-
*/
|
|
11
|
-
getWitness: (key: Field) => RollupMerkleWitness;
|
|
12
|
-
}
|
|
13
|
-
export declare class NoOpStateTransitionWitnessProvider implements StateTransitionWitnessProvider {
|
|
14
|
-
getWitness(key: Field): RollupMerkleWitness;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=StateTransitionWitnessProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StateTransitionWitnessProvider.d.ts","sourceRoot":"","sources":["../../../src/prover/statetransition/StateTransitionWitnessProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAEjF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,UAAU,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,mBAAmB,CAAC;CACjD;AAED,qBACa,kCACX,YAAW,8BAA8B;IAElC,UAAU,CAAC,GAAG,EAAE,KAAK,GAAG,mBAAmB;CAGnD"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { StateTransitionWitnessProvider } from "./StateTransitionWitnessProvider";
|
|
2
|
-
export declare class StateTransitionWitnessProviderReference {
|
|
3
|
-
private witnessProvider?;
|
|
4
|
-
setWitnessProvider(provider: StateTransitionWitnessProvider): void;
|
|
5
|
-
getWitnessProvider(): StateTransitionWitnessProvider | undefined;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=StateTransitionWitnessProviderReference.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StateTransitionWitnessProviderReference.d.ts","sourceRoot":"","sources":["../../../src/prover/statetransition/StateTransitionWitnessProviderReference.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAElF,qBAEa,uCAAuC;IAElD,OAAO,CAAC,eAAe,CAAC,CAAiC;IAElD,kBAAkB,CAAC,QAAQ,EAAE,8BAA8B;IAI3D,kBAAkB,IAAI,8BAA8B,GAAG,SAAS;CAGxE"}
|