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

CSUB-518: Pt. 1 - introduced set_gate_contract #1275

Merged
merged 3 commits into from
Aug 25, 2023
Merged

Conversation

zacharyfrederick
Copy link
Contributor

@zacharyfrederick zacharyfrederick commented Aug 24, 2023

This PR makes several important changes:

  1. It introduces the set_gate_contract extrinsic
  2. It renames the old GCreContract type to DeployedContract.

Rationale:

  1. In order to facilitate testing the swap token mechanics locally and on non-gluwa controlled test networks we allow the administrator of the blockchain to set the on-chain storage values for the GATE and GCRE contracts (the address that the contracts are deployed to, necessary for verifying function calls using the tx hash). This particular PR adds the extrinsic for the GATE contract as well as its associated on-chain storage. The extrinsic for setting the GCRE contract has been implemented previously.
  2. We abstracted the GCreContract to represent any deployed contract on an ethereum like blockchain. This required updating the integration tests for the previous GCRE->CTC functionality. The current request_collect_coins implementation is built entirely around the GCRE contract. This change will be more relevant when the request_collect_coins_v2 extrinsic is introduced.

Tests for set_burn_gate_contract

- [x] When not set the storage value should return the default goerli contract
- [x] The extrinsic can only be set by a root user
- [x] The extrinsic can be set and the storage value is persisted

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2023

Codecov Report

Merging #1275 (b3e142a) into dev (04688bb) will decrease coverage by 61.74%.
Report is 4 commits behind head on dev.
The diff coverage is n/a.

❗ Current head b3e142a differs from pull request most recent head a190be7. Consider uploading reports for the commit a190be7 to get more accurate results

@@            Coverage Diff             @@
##              dev   #1275       +/-   ##
==========================================
- Coverage   70.06%   8.32%   -61.74%     
==========================================
  Files         103      28       -75     
  Lines       12095     889    -11206     
  Branches      114     114               
==========================================
- Hits         8474      74     -8400     
+ Misses       3612     815     -2797     
+ Partials        9       0        -9     

see 83 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@zacharyfrederick zacharyfrederick changed the title introduced set_gate_contract CSUB-518-1: introduced set_gate_contract Aug 24, 2023
@atodorov atodorov changed the title CSUB-518-1: introduced set_gate_contract CSUB-518: Pt. 1 - introduced set_gate_contract Aug 24, 2023
@github-actions
Copy link

For full LLVM coverage report click here!

Copy link
Contributor

@atodorov atodorov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some adjustments for tests, otherwise looks good.

Note: I will merge the suggestions & squash some of the commits in the interest of fast turnaround time.

pallets/creditcoin/src/tests.rs Outdated Show resolved Hide resolved
pallets/creditcoin/src/tests.rs Outdated Show resolved Hide resolved
pallets/creditcoin/src/tests.rs Show resolved Hide resolved
pallets/creditcoin/src/tests.rs Outdated Show resolved Hide resolved
pallets/creditcoin/src/tests.rs Outdated Show resolved Hide resolved
pallets/creditcoin/src/tests.rs Show resolved Hide resolved
Zachary Frederick and others added 2 commits August 25, 2023 11:15
in preparation for request_collect_coins_v2
- fix initial WeightInfo to be greater than zero before benchmarks
  have the chance to update this appropriately
@pLabarta
Copy link
Contributor

Looks good to me, thanks for splitting it up

@atodorov atodorov merged commit 1ea82c7 into dev Aug 25, 2023
@atodorov atodorov deleted the csub-518-1-gate-contract branch August 25, 2023 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants