Skip to content

Commit

Permalink
Revert "[iip-15]sgdRegistry implementation (#3845)" (#4357)
Browse files Browse the repository at this point in the history
This reverts commit 23645ff.
  • Loading branch information
dustinxie committed Aug 8, 2024
1 parent 71dfae2 commit d592793
Show file tree
Hide file tree
Showing 16 changed files with 39 additions and 849 deletions.
3 changes: 2 additions & 1 deletion action/protocol/execution/evm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ func processSGD(ctx context.Context, sm protocol.StateManager, execution *action
return nil, 0, nil
}

receiver, percentage, ok, err := sgd.CheckContract(ctx, execution.Contract())
contract, _ := address.FromBytes((*execution.To())[:])
receiver, percentage, ok, err := sgd.CheckContract(ctx, contract.String())
if err != nil || !ok {
return nil, 0, err
}
Expand Down
32 changes: 16 additions & 16 deletions action/protocol/execution/testdata-istanbul/iip15-manager.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions action/protocol/execution/testdata-istanbul/iip15-manager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract IIP15Manager is Ownable {

event ContractRegistered(address contractAddress, address recipient);
event ContractApproved(address contractAddress);
event ContractDisapproved(address contractAddress);
event ContractUnapproved(address contractAddress);
event ContractRemoved(address contractAddress);

function registerContract(address _contractAddress, address _recipient) public {
Expand All @@ -39,7 +39,7 @@ contract IIP15Manager is Ownable {
require(contractInfo.recipient != address(0), "Contract is not registered");
require(contractInfo.isApproved, "Contract is not approved");
contractInfo.isApproved = false;
emit ContractDisapproved(_contractAddress);
emit ContractUnapproved(_contractAddress);
}

function removeContract(address _contractAddress) public onlyOwner {
Expand Down
2 changes: 0 additions & 2 deletions blockchain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type (
BloomfilterIndexDBPath string `yaml:"bloomfilterIndexDBPath"`
CandidateIndexDBPath string `yaml:"candidateIndexDBPath"`
StakingIndexDBPath string `yaml:"stakingIndexDBPath"`
SGDIndexDBPath string `yaml:"sgdIndexDBPath"`
ContractStakingIndexDBPath string `yaml:"contractStakingIndexDBPath"`
ID uint32 `yaml:"id"`
EVMNetworkID uint32 `yaml:"evmNetworkID"`
Expand Down Expand Up @@ -87,7 +86,6 @@ var (
BloomfilterIndexDBPath: "/var/data/bloomfilter.index.db",
CandidateIndexDBPath: "/var/data/candidate.index.db",
StakingIndexDBPath: "/var/data/staking.index.db",
SGDIndexDBPath: "/var/data/sgd.index.db",
ContractStakingIndexDBPath: "/var/data/contractstaking.index.db",
ID: 1,
EVMNetworkID: 4689,
Expand Down
4 changes: 0 additions & 4 deletions blockchain/genesis/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,6 @@ type (
SystemStakingContractAddress string `yaml:"systemStakingContractAddress"`
// SystemStakingContractHeight is the height of system staking contract
SystemStakingContractHeight uint64 `yaml:"systemStakingContractHeight"`
// SystemSGDContractAddress is the address of system sgd contract
SystemSGDContractAddress string `yaml:"systemSGDContractAddress"`
// SystemSGDContractHeight is the height of system sgd contract
SystemSGDContractHeight uint64 `yaml:"systemSGDContractHeight"`
// SystemStakingContractV2Address is the address of system staking contract
SystemStakingContractV2Address string `yaml:"systemStakingContractV2Address"`
// SystemStakingContractV2Height is the height of system staking contract
Expand Down
93 changes: 5 additions & 88 deletions blockindex/indexpb/index.pb.go

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

9 changes: 1 addition & 8 deletions blockindex/indexpb/index.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
// This source code is governed by Apache License 2.0 that can be found in the LICENSE file.

// To compile the proto, run:
// protoc --go_out=. *.proto
// option go_package = "../indexpb"; is to specify the package name in the generated go file
// protoc --go_out=plugins=grpc:. *.proto
syntax = "proto3";
package indexpb;

Expand All @@ -18,9 +17,3 @@ message BlockIndex {
message ActionIndex {
uint64 blkHeight = 1;
}

message SGDIndex {
bytes contract = 1;
bytes receiver = 2;
bool approved = 3;
}
Loading

0 comments on commit d592793

Please sign in to comment.