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

Revert "[iip-15]sgdRegistry implementation (#3845) " #4357

Merged
merged 8 commits into from
Aug 12, 2024
Prev Previous commit
Next Next commit
Revert "[iip15] fix caused an error within EVM when the contract was …
…not registered (#3929)"

This reverts commit 8eb196d.
  • Loading branch information
dustinxie committed Aug 12, 2024
commit bc2fdcb652cf3071b045f2af652507ffd94c3917
4 changes: 0 additions & 4 deletions blockindex/sgd_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,6 @@ func (sgd *sgdRegistry) CheckContract(ctx context.Context, contract string, heig
}
sgdIndex, err := sgd.getSGDIndex(addr.Bytes())
if err != nil {
// if the contract is not registered, return nil to prevent the evm from throwing error
if errors.Cause(err) == db.ErrNotExist || errors.Cause(err) == db.ErrBucketNotExist {
return nil, 0, false, nil
}
return nil, 0, false, err
}

Expand Down
2 changes: 1 addition & 1 deletion blockindex/sgd_indexer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestNewSGDRegistry(t *testing.T) {
blk := createTestingBlock(builder, 4, h, exec, logs)
r.NoError(sgdRegistry.PutBlock(ctx, blk))
receiver, percentage, isApproved, err := sgdRegistry.CheckContract(ctx, registerAddress.String(), 4)
r.NoError(err)
r.ErrorContains(err, "not exist in DB")
r.Nil(receiver)
r.False(isApproved)
hh, err := sgdRegistry.Height()
Expand Down
3 changes: 3 additions & 0 deletions e2etest/sgd_registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func TestSGDRegistry(t *testing.T) {
"c375c2ef0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4",
},
checkContractExpect: checkContractExpectation{
errorContains: "not exist in DB",
contractAddress: registerAddress.String(),
},
},
Expand All @@ -189,6 +190,7 @@ func TestSGDRegistry(t *testing.T) {
"07f7aafb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4",
},
checkContractExpect: checkContractExpectation{
errorContains: "not exist in DB",
contractAddress: registerAddress.String(),
},
},
Expand Down Expand Up @@ -226,6 +228,7 @@ func TestSGDRegistry(t *testing.T) {
"07f7aafb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc4",
},
checkContractExpect: checkContractExpectation{
errorContains: "not exist in DB",
contractAddress: registerAddress.String(),
},
},
Expand Down