Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
b72acc4
the seed struct
goastler May 19, 2023
8ac9ae4
add seed, seed log and rewind window to storage + ctor
goastler May 19, 2023
729d59d
update seed method
goastler May 19, 2023
b89b96b
fmt
goastler May 19, 2023
534e40e
fix tests by adding rewind ctor parameter
goastler May 19, 2023
5ea4d92
use match instead of is_ok()
goastler May 19, 2023
0efb833
fmt
goastler May 19, 2023
f1885a8
trigger update seed upon provider mutation
goastler May 19, 2023
2db6296
update seed in provider_commit()
goastler May 19, 2023
218fd99
move seed block check sooner
goastler May 19, 2023
f7526f9
fmt
goastler May 19, 2023
be53c48
add provider and dapp change logging storage
goastler May 19, 2023
8c425ba
helper method prune_to_rewind_window()
goastler May 19, 2023
37d2d55
missing dataset_id_content in ProviderRecord
goastler May 19, 2023
090ce0b
update provider_log in provider_configure()
goastler May 19, 2023
9a6a31f
add deleted field to reflect when a dapp or provider has been deleted
goastler May 19, 2023
e23739e
add methods for recording a provider in the logs
goastler May 19, 2023
8a2d388
add dapp logging
goastler May 19, 2023
f244928
add account owner to the dapp log records
goastler May 19, 2023
3c63857
typo in status
goastler May 19, 2023
d7cae65
remove log macro, doesn't work well, revert to normal code
goastler May 19, 2023
78549de
fmt
goastler May 19, 2023
4c05721
clippy
goastler May 19, 2023
5a4d4bd
implement ordering for structs with a block number, i.e. all records …
goastler May 19, 2023
3548df1
change logs to btreesets to make logging and pruning quicker and less…
goastler May 19, 2023
6df06b1
add setter to enable splitting of btreeset
goastler May 19, 2023
410e66e
replace BTreeSet with BTreeMap with BlockNumber a key
goastler May 19, 2023
dd0aaa0
make prune method use BTreeMap
goastler May 19, 2023
4c98845
remove custom trait for ordering by block number in favour of using B…
goastler May 19, 2023
a5c998c
insert log records using block number as key
goastler May 19, 2023
54be2b1
fmt
goastler May 19, 2023
00c5f47
clippy
goastler May 19, 2023
f0cd226
get_seed_at(); get_dapp_at(); get_provider_at()
goastler May 19, 2023
83bb9d8
fix get_X_at() inclusive of block number
goastler May 19, 2023
949511c
change get_provider_at() and get_dapp_at() to provider_rewind() and d…
goastler May 19, 2023
df317b8
fmt
goastler May 19, 2023
1b8c803
fmt
goastler May 22, 2023
2010388
Merge branch 'logging' into rewind
goastler May 22, 2023
38677a9
apply a record to a provider/dapp
goastler May 23, 2023
42caca3
restructure logs for per provider/dapp
goastler May 23, 2023
3a5ad41
change to using provider oriented logging
goastler May 23, 2023
92f2602
revised recording and logging mechanism for dapps + providers
goastler May 23, 2023
eb025cc
minor renaming of fields
goastler May 23, 2023
02f092f
avoid needless clone of dapp
goastler May 23, 2023
607d17d
start of get_active_providers_at()
goastler May 23, 2023
bc8e8c9
mapping for provider logs
goastler May 23, 2023
bb8bb66
mapping for dapp logs
goastler May 23, 2023
ce25665
get_active_providers_at()
goastler May 23, 2023
e851399
get_seed_at_user_dapp(); get a seed given a user, dapp and block number
goastler May 23, 2023
1bc31d3
get_random_active_provider_at()
goastler May 23, 2023
83285cc
get_random_active_provider_account()
goastler May 23, 2023
01af421
refactor RandomProvider to RandomActiveProvider
goastler May 23, 2023
c18b32f
remove duplicate get_random_active_provider()
goastler May 23, 2023
c525307
prune seed log in the update seed method directly
goastler May 23, 2023
6a3b381
split user sig into two parts until we have access to array >32 eleme…
goastler May 24, 2023
ed1abb2
fix tests
goastler May 24, 2023
e7a3cb1
fmt
goastler May 24, 2023
f858515
Merge branch 'main' into signature-parts
goastler May 24, 2023
d050a55
Merge remote-tracking branch 'origin/signature-parts' into rewind_usi…
goastler May 24, 2023
832253d
update seed after logging provider
goastler May 25, 2023
04e5ec1
update the seed once during provider commit rather than many times
goastler May 25, 2023
caeae6e
Merge remote-tracking branch 'origin/signature-parts' into rewind_usi…
goastler May 25, 2023
98fb7ee
validate_commit() using user signature
goastler May 25, 2023
ad275b8
add validate_commit() in provider_commit()
goastler May 25, 2023
77215f4
Merge branch 'validate_commit' into rewind_using_mapping
goastler May 25, 2023
1493311
disable validate commit
goastler May 25, 2023
1099c0e
rename provider_id to provider_account
goastler May 25, 2023
af46287
unit test stubs
goastler May 25, 2023
ed3847a
mark contract account as a contract
goastler May 25, 2023
70ecfe4
add get_dapp_contract() util method and mark account as a contract
goastler May 25, 2023
409c5c8
fix for default fee and payee for a provider
goastler May 25, 2023
9436e78
build a populated contract util method
goastler May 25, 2023
39a0060
test update seed role
goastler May 25, 2023
78298ca
test_update_seed_once_per_block()
goastler May 25, 2023
15891f3
add unwraps to catch errors in test util methods
goastler May 25, 2023
e646827
test_provider_update/register() url empty
goastler May 25, 2023
c9619c5
getters
goastler May 25, 2023
20e5a10
test provider fee to large
goastler May 25, 2023
dab28be
typos
goastler May 25, 2023
56d9ddd
get_admin()
goastler May 25, 2023
1920940
use getters in tests for ctor
goastler May 25, 2023
467b40f
test_get_rewind_window_start()
goastler May 25, 2023
0c859da
use reset_caller_and_callee()
goastler May 25, 2023
81797bf
refactor instantiation guard account into constant
goastler May 25, 2023
30c6dea
use author constant in ctor test
goastler May 25, 2023
db0da47
move author constant into module
goastler May 25, 2023
6a21cc9
fix account from bytes in tests
goastler May 25, 2023
90adec7
missing mut
goastler May 25, 2023
8a69fbd
add dapp contract account into uniqueness checks in tests
goastler May 25, 2023
4e70982
get_seed_at() test
goastler May 25, 2023
ff34fee
test get_payees()
goastler May 25, 2023
81c10ce
test get_dapp_payees()
goastler May 25, 2023
e279dca
test get_statuses()
goastler May 25, 2023
1a435d9
test get_seed_at_past_rewind_window()
goastler May 25, 2023
36875aa
check inside block window
goastler May 25, 2023
1a7d746
add current seed into get_seeds()
goastler May 26, 2023
e4fc038
remove seed struct to simplify seed handling in history
goastler May 26, 2023
1c36c42
fix dapp_payee test
goastler May 26, 2023
508bbcb
fix provider_payee test
goastler May 26, 2023
e111a19
disable all tests except simple ones
goastler May 26, 2023
fc1d912
fix callee issues in tests
goastler May 26, 2023
7fc35a5
fix test_get_seed_at_past_rewind_window()
goastler May 26, 2023
ba43fe0
get_seed_at() future block test
goastler May 26, 2023
7fd2161
increment_block()
goastler May 26, 2023
f802cc9
test get_provider_at() block in past/future
goastler May 26, 2023
08aef5c
test get_dapp_at() block in past/future
goastler May 26, 2023
b92b0eb
fmt
goastler May 26, 2023
1d5f124
reset callee after reg provider or dapp
goastler May 26, 2023
4b95667
fix noisy error printing when error is handled gracefully
goastler May 26, 2023
c76547a
optimise cloning old provider to new
goastler May 26, 2023
cf3dd00
move no change check in provider config
goastler May 26, 2023
f6c7737
use field expansion
goastler May 26, 2023
97b93ee
fix provider change check to consider new provider
goastler May 26, 2023
395640f
fix noisy error check when error is handled gracefully
goastler May 26, 2023
d391add
fix block limit tests for at fns
goastler May 26, 2023
0af2b7d
move printing of errors outside module
goastler May 26, 2023
ad1df63
fixes
goastler May 26, 2023
d71b81a
remove named_functions macro to save contract size
goastler May 26, 2023
354cabc
pass self in err macro calls rather than injecting to save space
goastler May 26, 2023
7bd0e52
remove inject_self and function_name macro dependencies
goastler May 26, 2023
6946a4e
enable at block tests
goastler May 26, 2023
feb1520
fix provider url empty check
goastler May 26, 2023
cc68ff9
fix provider and dapp register using stakes; set provider dataset id
goastler May 26, 2023
a7a9cad
fix update seed test
goastler May 26, 2023
9308e15
move update seed to calling fns
goastler May 26, 2023
d885765
rename get_seed_at_user_dapp
goastler May 26, 2023
a47b20f
test_get_rewind_window_start()
goastler May 26, 2023
1194580
fix author in ctor instantiate guard
goastler May 26, 2023
da90d7b
make seed log use Mapping and prune all logs
goastler May 26, 2023
043015b
got test_seed_at working
goastler May 26, 2023
81d8180
fix test_update_seed_caller()
goastler May 26, 2023
66a41c7
added in some disabled tests
goastler May 26, 2023
1a016ea
remove unwrap_err() from tests - expect specific errors instead
goastler May 26, 2023
5735c35
fmt
goastler May 26, 2023
5ce2956
docs + minor fixes
goastler May 26, 2023
42eb011
fmt
goastler May 26, 2023
31f3e4c
Merge branch 'main' into validate_commit
goastler May 31, 2023
963c447
fmt
goastler May 31, 2023
6146834
Merge remote-tracking branch 'origin/validate_commit' into validate_c…
goastler May 31, 2023
bfedd7a
fmt
goastler May 31, 2023
9dd14aa
Merge branch 'validate_commit' into rewind_using_mapping
goastler May 31, 2023
97b9cf8
Merge branch 'main' into rewind_using_mapping
goastler May 31, 2023
ceb6ba9
reduce max_user_history_age in tests to fit in as a block number rath…
goastler May 31, 2023
c3e9bd1
allow unused imports on storage layout and debug
goastler May 31, 2023
e0ec6e7
remove named funcs and inject self macro from proxy
goastler May 31, 2023
b6dea6b
move author to common
goastler May 31, 2023
29bff99
add ref to all contracts
goastler May 31, 2023
160acf6
use error macro to log all errors
goastler May 31, 2023
851d918
fmt
goastler May 31, 2023
be4debc
move account_id_bytes() to common
goastler May 31, 2023
7239c5b
renaming fields to be consistent (block, provider/user/dapp _account)
goastler May 31, 2023
15ad391
delegate provider get all to get by status
goastler May 31, 2023
ced4df9
rename dapp / contract to dapp_account
goastler May 31, 2023
daaa7e4
get all providers, users and dapps
goastler May 31, 2023
c1944bc
add set_code_hash() test for proxy
goastler Jun 2, 2023
601844d
rename dapp_users to users
goastler Jun 2, 2023
514b882
use a single `Mapping` to log changes to dapp OR providers
goastler Jun 2, 2023
0df8b6d
Revert "use a single `Mapping` to log changes to dapp OR providers"
goastler Jun 2, 2023
abe3e41
switch BTreeMap usage to Vec using enum as index
goastler Jun 2, 2023
50233ef
test_provider_register_already_exists()
goastler Jun 5, 2023
de81613
test_dapp_register_already_exists()
goastler Jun 5, 2023
ca741ad
test_provider_update_does_not_exist()
goastler Jun 5, 2023
e9f46f6
add should_exist parameter to provider_configure() to cover cases whe…
goastler Jun 5, 2023
60b4f9b
move dapp exists / does not exist into dapp_configure()
goastler Jun 5, 2023
98afb55
test_provider_deactivate_does_not_exist()
goastler Jun 5, 2023
4b722f6
test_provider_deregister_does_not_exist()
goastler Jun 5, 2023
3d6266d
test_dapp_update_does_not_exist
goastler Jun 5, 2023
fba0d8f
test_dapp_fund_does_not_exist()
goastler Jun 5, 2023
5657573
test_dapp_deactivate_does_not_exist()
goastler Jun 5, 2023
7605a80
test_dapp_deregister_does_not_exist()
goastler Jun 5, 2023
3b58d68
test_dapp_update_is_contract()
goastler Jun 5, 2023
c14a3f6
test_dapp_register_is_contract()
goastler Jun 5, 2023
8031513
improved test helper methods for registering and activating dapps + p…
goastler Jun 5, 2023
4f91389
fixed tests with overhaul to setup_provider() and setup_dapp() helpers
goastler Jun 6, 2023
c838bd0
remove short circuit checks, doesn't save gas
goastler Jun 6, 2023
9707c29
fix test_update_seed_caller block issue
goastler Jun 6, 2023
22a451e
remove caller and callee resets, let caller manage that
goastler Jun 6, 2023
4e36a9f
add missing provider to test
goastler Jun 6, 2023
495148f
fix test_get_seed_at() and get_seed_at() indexing
goastler Jun 6, 2023
e2e224a
test_provider_register_url_in_use()
goastler Jun 6, 2023
1b98c1e
test_provider_register_inactive()
goastler Jun 6, 2023
e3678e8
provider_register() will never update the seed as provider is not active
goastler Jun 6, 2023
b47990f
test_provider_update_active_updates_seed()
goastler Jun 6, 2023
284d84a
test_provider_update_inactive_does_not_update_seed()
goastler Jun 6, 2023
6ea8b58
test_provider_fund_active_updates_seed()
goastler Jun 6, 2023
853b50e
test_provider_fund_inactive_does_not_update_seed()
goastler Jun 6, 2023
229a32a
test_provider_set_dataset_active_updates_seed()
goastler Jun 6, 2023
ec6877e
test_provider_set_dataset_inactive_does_not_update_seed()
goastler Jun 6, 2023
c661f4c
provider deactivate update seed tests
goastler Jun 6, 2023
dc85259
make update_seed() throw ProviderDoesNotExist instead of NotAuthorised
goastler Jun 6, 2023
16de2c4
provider_deregister update seed tests
goastler Jun 6, 2023
8aefcc6
give the contract some funds on instantatiation in unit tests to avoi…
goastler Jun 6, 2023
c945f72
test provider_register does not change the seed
goastler Jun 6, 2023
7030f40
test_provider_register()
goastler Jun 6, 2023
c459afb
test_update_seed_reproducibility()
goastler Jun 6, 2023
92d2b6d
test provider_register logs previous provider state
goastler Jun 6, 2023
a47173e
test provider deregister + deactivate
goastler Jun 6, 2023
09a46fd
check for provider account in group in testing
goastler Jun 6, 2023
087e49e
do checks in test provider helper methods
goastler Jun 6, 2023
3d900ad
add checks to test dapp helper methods
goastler Jun 6, 2023
76e8dd5
test_provider_set_dataset_same_id()
goastler Jun 6, 2023
cd13257
adjust seed reproducibility tests
goastler Jun 6, 2023
b6e01b7
test_payee_mapping()
goastler Jun 6, 2023
5f47202
check provider account is in list of all accounts
goastler Jun 6, 2023
ba8bba3
test get_provider_accounts()
goastler Jun 6, 2023
8c6f068
test get_dapp_accounts()
goastler Jun 6, 2023
d0f1720
remove pub method attrs
goastler Jun 7, 2023
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
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions contracts/captcha/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
hex = "0.4.3"

[dependencies.inject_self_macro]
version = "0.3.0"
path = "../../crates/inject_self_macro"

[dependencies.named_functions_macro]
version = "0.3.0"
path = "../../crates/named_functions_macro"

[dependencies.disable_macro]
version = "0.3.0"
path = "../../crates/disable_macro"
Expand Down
Loading