Skip to content

Commit

Permalink
Merge pull request #93 from d-ylee/bugfix-92-fix_unit_tests
Browse files Browse the repository at this point in the history
Fix for Issue #92
  • Loading branch information
d-ylee authored Feb 28, 2023
2 parents 2558d16 + a1f83de commit 928dc25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions dbs/bulkblocks2.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ func checkBlockExist(bName, hash string) error {
}
defer tx.Rollback()
if rid, err := GetID(tx, "BLOCKS", "block_id", "block_name", bName); err == nil && rid != 0 {
err := errors.New(fmt.Sprintf("Block %s already exists", bName))
msg := "Data already exist in DBS"
msg := fmt.Sprintf("Block %s already exists", bName)
return Error(err, BlockAlreadyExists, msg, "dbs.bulkblocks.checkBlockExist")
}
return nil
Expand Down
5 changes: 2 additions & 3 deletions test/int_bulkblocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,11 @@ func getBulkBlocksLargeFileLumiInsertTestTable(t *testing.T) EndpointTestCase {
func bulkblocksTheSameBlockInsertTestTable(t *testing.T) EndpointTestCase {
// there are multiple blocks to insert, but everything is started from parent blocks
bName := TestData.ParentStepchainBlock
reason := fmt.Sprintf("Block %s already exists", bName)
msg := "Data already exist in DBS"
msg := fmt.Sprintf("Block %s already exists", bName)
dbsError := dbs.DBSError{
Function: "dbs.bulkblocks.checkBlockExist",
Code: dbs.BlockAlreadyExists,
Reason: reason,
Reason: "nil",
Message: msg,
}
hrec := createHTTPError("POST", "/dbs/bulkblocks")
Expand Down

0 comments on commit 928dc25

Please sign in to comment.