forked from IntersectMBO/cardano-db-sync
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
168 changed files
with
345 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{-# LANGUAGE TypeApplications #-} | ||
|
||
module Cardano.Mock.Query ( | ||
queryVersionMajorFromEpoch, | ||
queryParamProposalFromEpoch, | ||
) where | ||
|
||
import qualified Cardano.Db as Db | ||
import Cardano.Prelude hiding (from) | ||
import Database.Esqueleto.Experimental | ||
import Prelude () | ||
|
||
-- | Query protocol parameters from @EpochParam@ by epoch number. Note that epoch | ||
-- parameters are inserted at the beginning of the next epoch. | ||
-- | ||
-- TODO[sgillespie]: It would probably be better to return @Db.EpochParam@, but | ||
-- persistent seems to be having trouble with the data: | ||
-- | ||
-- PersistMarshalError "Couldn't parse field `govActionLifetime` from table | ||
-- `epoch_param`. Failed to parse Haskell type `Word64`; expected integer from | ||
-- database, but received: PersistRational (0 % 1). | ||
queryVersionMajorFromEpoch :: | ||
MonadIO io => | ||
Word64 -> | ||
ReaderT SqlBackend io (Maybe Word16) | ||
queryVersionMajorFromEpoch epochNo = do | ||
res <- selectOne $ do | ||
prop <- from $ table @Db.EpochParam | ||
where_ (prop ^. Db.EpochParamEpochNo ==. val epochNo) | ||
pure (prop ^. Db.EpochParamProtocolMajor) | ||
pure $ unValue <$> res | ||
|
||
-- | Query protocol parameter proposals from @ParamProposal@ by epoch number. | ||
queryParamProposalFromEpoch :: | ||
MonadIO io => | ||
Word64 -> | ||
ReaderT SqlBackend io (Maybe Db.ParamProposal) | ||
queryParamProposalFromEpoch epochNo = do | ||
res <- selectOne $ do | ||
prop <- from $ table @Db.ParamProposal | ||
where_ $ prop ^. Db.ParamProposalEpochNo ==. val (Just epochNo) | ||
pure prop | ||
pure $ entityVal <$> res |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
cardano-chain-gen/test/testfiles/fingerprint/CLAMigrateAndPruneRestart
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
cardano-chain-gen/test/testfiles/fingerprint/CLANoPruneSameBlock
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,4,7,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469,453] | ||
[5,11,15,21,22,23,28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,506,509,512,515,518,524,526,518] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,4,7,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469] | ||
[5,11,15,21,22,23,28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,506,509,512,515,518,524,526] |
2 changes: 1 addition & 1 deletion
2
cardano-chain-gen/test/testfiles/fingerprint/CLAPruneAndRollBack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,4,7,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469,471,471,474,487,489,490,492,497,498,515,519,520,524,528,529,530,531,554,557,567,568,575,576,597,603,615,616,631,637,640,641,643,650,654,656,657,662,668,676,678,688,694,695,698,700,701,702,703,716,725,727,729,730,732,733,738,747,750,771,774,777,778,780,785,796,798,799,805,808,819,821,822,827,831,833,835,838,841,844,847,848,858,859,860,863,864,872,875,889,906,912,913,914,917,942,943,945,948,950,952,954,955,959,967] | ||
[5,11,15,21,22,23,28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,506,509,512,515,518,524,526,527,527,530,541,542,549,556,561,570,576,578,579,583,589,596,597,609,611,615,620,621,627,633,634,644,650,651,654,661,671,675,680,682,687,694,698,703,705,711,716,718,726,728,730,739,748,749,757,761,782,784,785,791,796,798,815,818,823,837,845,846,847,858,862,865,877,879,881,882,884,885,888,890,892,893,895,898,900,904,908,916,921,922,923,929,930,932,934,936,950,956,957,968,969,985,992,993,994,1013,1021,1024,1031,1036,1041] |
2 changes: 1 addition & 1 deletion
2
cardano-chain-gen/test/testfiles/fingerprint/CLAPruneCorrectAmount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,4,7,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469,471,474,487,489,490,492,497,498,515,519,520,524,528,529,530,531,554,557,567,568,575,576,597,603,615,616,631,637,640,641,643,650,654,656,657,662,668,676,678,688,694,695,698,700,701,702,703,716,725,727,729,730,732,733,738,747,750,771,774,777,778,780,785,796,798,799,805,808,819,821,822,827,831,833,835,838,841,844,847,848,858,859,860,863,864,872,875,889,906,912,913,914,917,942,943,945,948,950,952,954,955,959,967,971,980,981,983,993,997,1008] | ||
[5,11,15,21,22,23,28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,506,509,512,515,518,524,526,527,530,541,542,549,556,561,570,576,578,579,583,589,596,597,609,611,615,620,621,627,633,634,644,650,651,654,661,671,675,680,682,687,694,698,703,705,711,716,718,726,728,730,739,748,749,757,761,782,784,785,791,796,798,815,818,823,837,845,846,847,858,862,865,877,879,881,882,884,885,888,890,892,893,895,898,900,904,908,916,921,922,923,929,930,932,934,936,950,956,957,968,969,985,992,993,994,1001,1003,1004,1009,1019,1026,1028,1031,1040,1043,1047,1051,1053] |
2 changes: 1 addition & 1 deletion
2
cardano-chain-gen/test/testfiles/fingerprint/CLAPruneOnFullRollback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,3] | ||
[5,11,11] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,4,7,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469,339] | ||
[5,11,15,21,22,23,28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,506,509,512,515,518,524,526,418] |
2 changes: 1 addition & 1 deletion
2
cardano-chain-gen/test/testfiles/fingerprint/CLAPruneSimpleRollback
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469,471,474,487] | ||
[28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,510,513,514,519,521,522,523,529,533,536,539,545,549] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1] | ||
[5] |
2 changes: 1 addition & 1 deletion
2
cardano-chain-gen/test/testfiles/fingerprint/CLAcheckEpochDisabledArg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1,3,4,7,8,9,10,11,14,30,31,33,34,35,40,42,44,61,62,74,76,82,85,88,89,93,95,102,104,106,111,114,120,123,141,143,146,149,158,170,171,178,186,190,198,201,207,209,210,221,223,227,245,249,250,259,260,265,272,276,283,284,294,296,301,305,306,311,312,317,318,321,322,325,331,333,337,339,345,347,348,350,365,375,377,379,382,391,394,401,407,411,413,415,424,428,445,453,467,469,471,474,487,489,490,492,497,498,515,519,520,524] | ||
[5,11,15,21,22,23,28,33,34,36,42,43,48,52,62,82,88,92,102,106,109,111,116,133,134,143,151,153,157,161,162,171,182,183,193,195,196,197,200,206,208,216,219,222,238,245,250,262,271,272,275,282,286,296,301,310,311,314,325,340,347,354,355,365,376,379,382,384,389,390,391,392,393,398,404,407,414,418,419,422,424,446,448,450,457,465,476,478,485,486,488,499,503,506,509,512,515,518,524,526,527,530,541,542,549,556,561,570,576,578,579,583] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[1] | ||
[28] |
Oops, something went wrong.