Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dry ticket length, increase ticket length from 5 to 6, make max holders configurable #55

Merged
merged 37 commits into from
Dec 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
738c99a
fix: wip prize buckets
Ruborcalor Dec 8, 2021
c0e4171
fix: get all tests to pass
Ruborcalor Dec 8, 2021
7d9c349
fix: add test to simulate jackpot lottery growth
Ruborcalor Dec 9, 2021
1bdef7f
fix: attempt to fix the integration test
Ruborcalor Dec 9, 2021
3112942
style: use fold instead of for loop
Ruborcalor Dec 9, 2021
1b454c5
build: update schema artifacts
Ruborcalor Dec 9, 2021
d0941a0
fix: update integration tests to use anchor_mock
Ruborcalor Dec 9, 2021
8b5f201
fix: pass clippy
Ruborcalor Dec 9, 2021
8ba1d9a
test: update jackpot simulation outputs
Ruborcalor Dec 9, 2021
1484f6b
test: improve jackpot simulation output
Ruborcalor Dec 9, 2021
3984234
feat: add function calculate_lottery_balance
Ruborcalor Dec 9, 2021
d029d51
fix: update query_glow_emission_rate calculation
Ruborcalor Dec 9, 2021
0696833
fix: update execute_epoch_ops to calculate lottery_balance
Ruborcalor Dec 9, 2021
42a35fd
fix: update lottery balance calculation
Ruborcalor Dec 9, 2021
d115d9d
feat: add LotteryBalance query
Ruborcalor Dec 9, 2021
8918ed8
fix: update return type to StdResult instead of Result
Ruborcalor Dec 9, 2021
8404ab7
fix: add LotteryBalanceResponse to lotto/examples/schema.rs
Ruborcalor Dec 9, 2021
57b785a
fix: pass clippy
Ruborcalor Dec 9, 2021
1a40f27
fix: use enumerate instead of iterating over indicies
Ruborcalor Dec 9, 2021
592fd68
feat: increase ticket length
Ruborcalor Dec 10, 2021
7144453
build: build artifacts
Ruborcalor Dec 9, 2021
b565496
fix: pass clippy
Ruborcalor Dec 10, 2021
21e152a
fix: update oracle to use ticket length when generating hash
Ruborcalor Dec 10, 2021
51eafa8
fix: change ticket length to 5
Ruborcalor Dec 10, 2021
3eaa97c
test: update tests to pass
Ruborcalor Dec 10, 2021
b2a22e5
feat: update error types to give more details
Ruborcalor Dec 11, 2021
1bee66d
fix: error message for InvalidHolderSequence
Ruborcalor Dec 13, 2021
994fbd3
fix: pass clippy
Ruborcalor Dec 13, 2021
46763b0
Merge branch 'main' into feat/dry-ticket-length
Ruborcalor Dec 13, 2021
f54ce58
fix: adjust pseudo_random_hash based on ticket length
Ruborcalor Dec 23, 2021
5de821f
fix: increase MAX_LIMIT to 10000 from 100 for prize pagination
Ruborcalor Dec 23, 2021
a2cf6a0
fix: dry ticket length glow_protocol
Ruborcalor Dec 23, 2021
243f94e
fix: InsufficientPoolFunds pool_value value
Ruborcalor Dec 23, 2021
918e79d
Merge branch 'main' into feat/dry-ticket-length
Ruborcalor Dec 23, 2021
b45f76c
fix: update comment describing prize_distribution
Ruborcalor Dec 27, 2021
b6c0365
fix: update error message to specify 6 instead of 5 digits
Ruborcalor Dec 27, 2021
c4e9b83
feat: increase ticket length (#56)
Ruborcalor Dec 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions artifacts/checksums.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
9db98d88a804d2de1190fa94451cc5e513abd9cdd7f895edaa788a4947cafccf glow_airdrop.wasm
d891174841015592d032e8e2bd47b651bc1178ebf7104e33c3a5b8af7544f282 glow_community.wasm
f7f625218dc1c98f6bb60b52f561f17ec1d44e29a00ede2b824d53b313f22251 glow_distributor.wasm
a38171cb7dbe1d8ebd7e314a509d01d6d6274ea9058811de3ceb20545ea547cf glow_gov.wasm
dc9805f0c91d81930401945a663af1016491ccf5f16521b2b2c0b6d6a2ccbd10 glow_lotto.wasm
6f400c4cf4ab044d9f39b0b52bc8ca68de5f383cbc7172d131bd8f29ccc440e0 glow_staking.wasm
2e8b634cc3d46b93cd464dfab39af83f6755065edd79316e38996a707aae1755 glow_vesting.wasm
4721edb924c9c9bd0f18112c1f704979b9a55ef306200655d1229cd642614a84 glow_airdrop.wasm
a878b0acbe99da8a561c5a3b0475399000bec37b40a84c8ebcc9c85f1cdb7907 glow_community.wasm
9bffe4f88346fc5ed00042d8aed686d4c4735f4a88bc8d2748e0dced3e64129d glow_distributor.wasm
a66a62f942f60d257f20d357467f80c026b225adbd0e9e0d9d8a7dcea4e9b3e0 glow_gov.wasm
5607fdf2a153611f215e109b0f01754f6d77cef01d44cc7eefd0b1f85fce04b0 glow_lotto.wasm
b916cee8d5c7b59f06c10b6d0a84195f8be1e3e0e1cd5cf143083cecd43491fa glow_staking.wasm
adb3480088b3b03670121a0fbf97a71824e462009e9a98378cde3ee62e8b739e glow_vesting.wasm
14 changes: 7 additions & 7 deletions artifacts/checksums_intermediate.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
1f054c947b73538f8e72311bbeaf3576c7695e8cc0ae861c271f22d6a01ec2d7 target/wasm32-unknown-unknown/release/glow_airdrop.wasm
3952ced129733670a983690d1e9644534847907c664a1ef1fb4fd2027e0f00e7 target/wasm32-unknown-unknown/release/glow_community.wasm
86a15a195a6219b706739839fdf6c4186376a1013ef8c7e4a0f9cf3dbc98eb1b target/wasm32-unknown-unknown/release/glow_distributor.wasm
a0d2d7dc2ba0cb4857e24d7e89185d11a407029efb045b6cd22755db0ccd734c target/wasm32-unknown-unknown/release/glow_gov.wasm
aba3019d0e83b84636dadf14b3930a88051b022a6ec7e988e6c51f7f63cfedb0 target/wasm32-unknown-unknown/release/glow_lotto.wasm
c5ea4240cd41a46b4b00a704bd21cdd07bbb9070a2d432ea5ca91a032044f84f target/wasm32-unknown-unknown/release/glow_staking.wasm
83cf2a00d4c6e738f69677601cc822ad05e8d439db9ae87177f50750cca3cd57 target/wasm32-unknown-unknown/release/glow_vesting.wasm
cf040c0444cd1fdb751ac3f9eb77acf8896c7757eb6ac29e66d8c62e0bca11ae target/wasm32-unknown-unknown/release/glow_airdrop.wasm
f897131571aec6921eda8c226cd58f2bc093220e3bcdeb6cf0911757cb096531 target/wasm32-unknown-unknown/release/glow_community.wasm
7686923588dcfb8ce7b6c2c3c23ed0263953d58aefe4c87c04de67347b07ad42 target/wasm32-unknown-unknown/release/glow_distributor.wasm
bd15848999c9dab7743e75b3512a0284a1a7b0bcc1be39bb9e69fad00c176c8f target/wasm32-unknown-unknown/release/glow_gov.wasm
4bbb2e94ad6a9ea68457d17b4c7cfdb1a3a48d6d3d908a1b96be7e18ae526994 target/wasm32-unknown-unknown/release/glow_lotto.wasm
f00536014f7e10dc8bcc0d839c0fd917b6e20d38a66a3ab990bcb81822fb8963 target/wasm32-unknown-unknown/release/glow_staking.wasm
7a7ef43fb6aa7597b1bb1aa9eab86ac629f5e11b2191b68933593938a88e7091 target/wasm32-unknown-unknown/release/glow_vesting.wasm
Binary file modified artifacts/glow_airdrop.wasm
Binary file not shown.
Binary file modified artifacts/glow_community.wasm
Binary file not shown.
Binary file modified artifacts/glow_distributor.wasm
Binary file not shown.
Binary file modified artifacts/glow_gov.wasm
Binary file not shown.
Binary file modified artifacts/glow_lotto.wasm
Binary file not shown.
Binary file modified artifacts/glow_staking.wasm
Binary file not shown.
Binary file modified artifacts/glow_vesting.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions contracts/lotto/schema/config_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"items": {
"$ref": "#/definitions/Decimal256"
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
},
"reserve_factor": {
"$ref": "#/definitions/Decimal256"
Expand Down
12 changes: 10 additions & 2 deletions contracts/lotto/schema/execute_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@
}
]
},
"max_holders": {
"type": [
"integer",
"null"
],
"format": "uint8",
"minimum": 0.0
},
"oracle_addr": {
"type": [
"string",
Expand Down Expand Up @@ -126,8 +134,8 @@
"items": {
"$ref": "#/definitions/Decimal256"
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
},
"round_delta": {
"type": [
Expand Down
4 changes: 2 additions & 2 deletions contracts/lotto/schema/instantiate_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
"items": {
"$ref": "#/definitions/Decimal256"
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
},
"reserve_factor": {
"$ref": "#/definitions/Decimal256"
Expand Down
8 changes: 4 additions & 4 deletions contracts/lotto/schema/lottery_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"format": "uint32",
"minimum": 0.0
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
},
"page": {
"type": "string"
Expand All @@ -39,8 +39,8 @@
"items": {
"$ref": "#/definitions/Uint256"
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
},
"rand_round": {
"type": "integer",
Expand Down
4 changes: 2 additions & 2 deletions contracts/lotto/schema/prize_info_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"format": "uint32",
"minimum": 0.0
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
}
},
"definitions": {
Expand Down
4 changes: 2 additions & 2 deletions contracts/lotto/schema/state_response.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"items": {
"$ref": "#/definitions/Uint256"
},
"maxItems": 6,
"minItems": 6
"maxItems": 7,
"minItems": 7
},
"total_reserve": {
"$ref": "#/definitions/Uint256"
Expand Down
1 change: 1 addition & 0 deletions contracts/lotto/src/anchor_mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use terra_multi_test::{Contract, ContractWrapper};

// This lazy static use allows you the dev to set the aust token addr before you use the anchor mock so that you can mock out AUST as needed.
lazy_static! {

// This lazily made static uses a ReadWrite lock to ensure some form of safety on setting/getting values and means you dont need to wrap the code in an unsafe block which looks icky
static ref AUST_ADDR_MOCK: RwLock<String> = RwLock::new("anchor".to_string());
}
Expand Down
Loading