Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Commit d2cc9b6

Browse files
authored
Merge pull request #4 from dOrgTech/lambda-patch
Fix Froze Extra value bug
2 parents 99c2271 + 7d60e8b commit d2cc9b6

24 files changed

Lines changed: 200 additions & 102 deletions

File tree

‎ligo/haskell/baseDAO-ligo-meta.cabal‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ test-suite baseDAO-test
233233
Test.Ligo.RegistryDAO.Tests.Common
234234
Test.Ligo.RegistryDAO.Tests.EmptyProposal
235235
Test.Ligo.RegistryDAO.Tests.ExecuteWonProposal
236+
Test.Ligo.RegistryDAO.Tests.FlushConfigUpdates
236237
Test.Ligo.RegistryDAO.Tests.FlushRegistryUpdates
237238
Test.Ligo.RegistryDAO.Tests.FlushTransferProposal
238239
Test.Ligo.RegistryDAO.Tests.LargeProposal

‎ligo/haskell/src/Ligo/BaseDAO/LambdaDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,7 @@ instance Buildable HandlerInfo where
124124
build = genericF
125125

126126
customGeneric "LambdaExtra" ligoLayout
127-
-- TODO [morley#922]: remove droRecursive=False here
128-
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout, droRecursive=False}
127+
deriveRPCWithOptions "LambdaExtra" def{droStrategy=ligoLayout}
129128
derivinganyclassinstanceIsoValueLambdaExtra
130129

131130
instanceHasAnnotationLambdaExtrawhere

‎ligo/haskell/src/Ligo/BaseDAO/RegistryDAO/Types.hs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ instance Default RegistryExtra where
7878
def =RegistryExtra (mkBigMap @(MapRegistryKeyRegistryValue) M.empty) (mkBigMap @(MapRegistryKeyProposalKey) M.empty) S.empty 10100011 zeroMutez [tz|1u|]
7979

8080
customGeneric "RegistryExtra" ligoLayout
81-
-- TODO [morley#922]: remove droRecursive=False here
82-
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout, droRecursive=False}
81+
deriveRPCWithOptions "RegistryExtra" def{droStrategy=ligoLayout}
8382

8483
instanceBuildableRegistryExtrawhere
8584
build = genericF

‎ligo/haskell/src/Ligo/BaseDAO/TreasuryDAO/Types.hs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ instance Buildable TreasuryExtra where
4545

4646
instanceHasRPCReprTreasuryExtrawhere
4747
typeAsRPCTreasuryExtra=TreasuryExtra
48-

‎ligo/haskell/src/Ligo/BaseDAO/Types.hs‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ import Lorentz hiding (div, now)
9595
importLorentz.Annotation ()
9696
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
9797
importLorentz.Contracts.Spec.TZIP16InterfacequalifiedasTZIP16
98-
importMorley.AsRPC (HasRPCRepr(..), deriveRPCWithOptions, DeriveRPCOptions(..))
98+
importMorley.AsRPC (DeriveRPCOptions(..), HasRPCRepr(..), deriveRPCWithOptions, deriveRPC)
9999
importMorley.Michelson.Typed.Annotation
100100
importMorley.Michelson.Typed.Scope
101101
(HasNoBigMap, HasNoContract, HasNoNestedBigMaps, HasNoOp, HasNoTicket)
102102
importMorley.Michelson.Typed.T (T(TUnit))
103103
importMorley.Michelson.Untyped.Annotation
104+
importMorley.Tezos.Address
104105
importMorley.Util.Markdown
105106
importMorley.Util.Named
106-
importMorley.Tezos.Address
107107
importTest.Cleveland.Instances ()
108108

109109
--| A data type to track and specify the different DAO variants in existence
@@ -147,8 +147,8 @@ instance HasAnnotation FA2.Parameter
147147
frozenTokenId::FA2.TokenId
148148
frozenTokenId =FA2.TokenId0
149149

150-
baseDaoAnnOptions::AnnOptions
151-
baseDaoAnnOptions =defaultAnnOptions { fieldAnnModifier =dropPrefixThen toSnake }
150+
baseDaoAnnOptions::MaybeAnnOptions
151+
baseDaoAnnOptions =Just def { fieldAnnModifier = toSnake. dropPrefix }
152152

153153
------------------------------------------------------------------------
154154
-- Proposals
@@ -316,7 +316,7 @@ instance HasAnnotation Delegate where
316316
instanceBuildableDelegatewhere
317317
build = genericF
318318

319-
typeDelegates'big_map=big_mapDelegate()
319+
typeDelegates'(big_map::Type->Type->Type)=big_mapDelegate()
320320

321321
typeDelegates=Delegates'BigMap
322322

@@ -658,8 +658,7 @@ instance Buildable ProposalDoublyLinkedList where
658658
instanceHasAnnotationProposalDoublyLinkedListwhere
659659
annOptions = baseDaoAnnOptions
660660

661-
-- TODO [morley#922]: remove droRecursive=False here
662-
deriveRPCWithOptions "ProposalDoublyLinkedList" def{droRecursive=False}
661+
deriveRPC "ProposalDoublyLinkedList"
663662

664663
instanceHasRPCRepr (DynamicRecs) where
665664
typeAsRPC (DynamicRecs) =DynamicRecViews
@@ -758,7 +757,6 @@ instance HasAnnotation ce => HasAnnotation (StorageSkeleton ce) where
758757
annOptions = baseDaoAnnOptions
759758
derivinganyclassinstanceIsoValuece=>IsoValue (StorageSkeletonce)
760759

761-
-- TODO [morley#922]: remove droRecursive=False here
762760
deriveRPCWithOptions "StorageSkeleton" def{droStrategy=ligoLayout, droRecursive=False}
763761
typeStorageRPC=StorageSkeletonRPC (VariantToExtra 'Base)
764762

‎ligo/haskell/src/Ligo/Typescript.hs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ nToType (NTChest _) = toType $ U.TChest
7676
nToType (NTChestKey _) = toType $U.TChestKey
7777
nToType (NTSaplingState _ a) = toType $U.TSaplingState (singNatToNatural a)
7878
nToType (NTSaplingTransaction _ a) = toType $U.TSaplingTransaction (singNatToNatural a)
79-
nToType (NTTxRollupL2Address _ ) = toType $U.TTxRollupL2Address
8079

8180
singNatToNatural::SingNatn->Natural
8281
singNatToNatural SZ=0
@@ -336,8 +335,6 @@ mkTypesFor typename epType = case U.unwrapT epType of
336335
error"In Ligo.Typescript.mkTypesFor: sappling state values not yet supported"
337336
U.TSaplingTransaction _ ->
338337
error"In Ligo.Typescript.mkTypesFor: sappling transaction values not yet supported"
339-
U.TTxRollupL2Address-> [TsType typename (TsAliasTsString)]
340-
341338
where
342339

343340
-- Mostly same as mkTypesFor, but check if the given type

‎ligo/haskell/test/SMT/Common/Gen.hs‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,18 @@ import Data.Map qualified as Map
1515
importHedgehog.GenqualifiedasGen
1616
importHedgehog.Gen.Tezos.Address (genAddress)
1717
importHedgehog.RangequalifiedasRange
18+
importFmt (pretty)
1819

1920
importHedgehog.Gen.Tezos.Crypto (genSecretKey)
2021
importLorentzhiding (cast, concat, get, not)
2122
importLorentz.Contracts.Spec.FA2InterfacequalifiedasFA2
2223
importMorley.Michelson.Typed.Haskell.Value (BigMap(..))
2324
importMorley.Tezos.Address
25+
importMorley.Tezos.Address.Alias
2426
importMorley.Tezos.Core (dummyChainId)
2527
importMorley.Tezos.Crypto (SecretKey, sign, toPublic)
2628
importMorley.Util.Named
29+
importTest.Cleveland (AddressWithAlias(..), ImplicitAddressWithAlias)
2730

2831
importLigo.BaseDAO.Common.Types
2932
importLigo.BaseDAO.Types
@@ -35,7 +38,12 @@ genMkModelInput option@SmtOption{..} = do
3538

3639
-- Initial
3740
addrs <- genSecretKey
38-
<&> (\secret -> (mkKeyAddress . toPublic $ secret, secret))
41+
<&> (\secret ->
42+
( AddressWithAlias
43+
{ awaAddress = mkKeyAddress $ toPublic secret
44+
, awaAlias = mkAlias . ("addr_"<>) . pretty $ toPublic secret
45+
}
46+
, secret))
3947
& vectorOf poolSize
4048
startLevel <-Gen.integral (Range.constant 010)
4149

@@ -209,13 +217,13 @@ genRandomCalls = do
209217
>>=Gen.subsequence
210218

211219
where
212-
genTransferContractTokensCall::ImplicitAddress->GeneratorTcep (Address->ModelCallcep)
220+
genTransferContractTokensCall::ImplicitAddressWithAlias->GeneratorTcep (Address->ModelCallcep)
213221
genTransferContractTokensCall sender1 =do
214222
f <- genTransferContractTokens @cep
215223
pure$\govAddr -> mkSimpleContractCall sender1 $ f govAddr
216224

217225

218-
mkSimpleContractCall::ImplicitAddress->Parameter' (VariantToParamvar) ->ModelCallvar
226+
mkSimpleContractCall::ImplicitAddressWithAlias->Parameter' (VariantToParamvar) ->ModelCallvar
219227
mkSimpleContractCall sender1 param =do
220228
ModelCall
221229
{ mcAdvanceLevel =Nothing
@@ -344,8 +352,7 @@ genVote = do
344352
sign'::SecretKey->GeneratorTcep ( ByteString->Signature)
345353
sign' addr =do
346354
seed <- drgNewSeed . seedFromInteger <$>Gen.integral (Range.linearFrom 0-10001000)
347-
pure$\bytes ->fst$ withDRG seed $do
348-
sign addr bytes
355+
pure$fst. withDRG seed . sign addr
349356

350357
typeParameter''var=Parameter' (VariantToParamvar)
351358

‎ligo/haskell/test/SMT/Common/Types.hs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import Text.Show (show)
2323

2424
importTest.Cleveland.Lorentz.Types
2525
importLorentzhiding (cast, not)
26-
importMorley.Tezos.Address
2726
importMorley.Tezos.Crypto (SecretKey)
27+
importTest.Cleveland (ImplicitAddressWithAlias)
2828

2929
importLigo.BaseDAO.Types
3030
importSMT.Model.BaseDAO.Types
@@ -85,7 +85,7 @@ data SmtOption (var :: Variants) = SmtOption
8585

8686
--| Generator state, contains commonly used value that shared between generators.
8787
dataGeneratorStatecep=GeneratorState
88-
{gsAddresses:: [(ImplicitAddress, SecretKey)]
88+
{gsAddresses:: [(ImplicitAddressWithAlias, SecretKey)]
8989
, gsLevel::Natural
9090
, gsMkGenPropose::MkGenProposecep
9191
, gsMkCustomCalls::MkGenCustomCallscep

‎ligo/haskell/test/SMT/Model/BaseDAO/Permit.hs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Control.Monad.Except (throwError)
1111
importLorentzhiding (cast, checkSignature, get, not)
1212
importMorley.Tezos.Address (ImplicitAddress, mkKeyAddress)
1313
importMorley.Tezos.Crypto (checkSignature)
14+
importTest.Cleveland (toImplicitAddress)
1415

1516
importLigo.BaseDAO.Types
1617
importSMT.Model.BaseDAO.Types
@@ -21,7 +22,7 @@ verifyPermitProtectedVote mso permited = do
2122
case (permited & ppPermit) of
2223
Nothing->
2324
-- if there is no permit to check, return the votingParam and the sender
24-
pure (permited & ppArgument, mso & msoSender)
25+
pure (permited & ppArgument, mso & msoSender& toImplicitAddress)
2526
Just permit ->do
2627
-- if there is a permit, check that its correct
2728
permitCounter <- getStore <&> sPermitsCounter

‎ligo/haskell/test/SMT/Model/BaseDAO/Types.hs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import Lorentz.Contracts.Spec.FA2Interface qualified as FA2
3737
importMorley.Tezos.Address
3838
importMorley.Tezos.Core
3939
importMorley.Tezos.Crypto (HashTag)
40+
importTest.Cleveland (ImplicitAddressWithAlias)
4041

4142
importLigo.BaseDAO.ErrorCodes
4243
importLigo.BaseDAO.Types
@@ -213,8 +214,8 @@ instance Buildable (Parameter' (VariantToParam var)) => Buildable (ModelCall var
213214

214215
--| Definition of an @source@ and @sender@ for a call to emulate in the SMTs
215216
dataModelSource=ModelSource
216-
{msoSender::ImplicitAddress
217-
, msoSource::ImplicitAddress
217+
{msoSender::ImplicitAddressWithAlias
218+
, msoSource::ImplicitAddressWithAlias
218219
}derivingstock (Eq, Show, Generic)
219220

220221
instanceBuildableModelSourcewhere

0 commit comments

Comments
 (0)