Skip to content
This repository has been archived by the owner on Aug 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #137 from JayChoi1736/dev
Browse files Browse the repository at this point in the history
Version Update & Minor fix
  • Loading branch information
JayChoi1736 authored Oct 21, 2022
2 parents 83ca2bc + 4f776bd commit 702ded5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const (
SkipAdminEnv = "SKIP_ADMIN"

// MiddlewareVersion is the version of rosetta-klaytn.
MiddlewareVersion = "1.0.4"
MiddlewareVersion = "1.0.5"
)

// Configuration determines how
Expand Down
28 changes: 8 additions & 20 deletions integration/data_api_block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,17 @@ func TestBlock(t *testing.T) {
continue
}
assert.Equal(t, ret.Block.Transactions[i].TransactionIdentifier.Hash, testTxHash)
assert.Equal(t, 5, len(ret.Block.Transactions[i].Operations))
assert.Equal(t, 4, len(ret.Block.Transactions[i].Operations))
assert.Equal(t, klaytn.FeeOpType, ret.Block.Transactions[i].Operations[0].Type)
assert.Equal(t, klaytn.FeeOpType, ret.Block.Transactions[i].Operations[1].Type)
assert.Equal(t, klaytn.FeeOpType, ret.Block.Transactions[i].Operations[2].Type)
assert.Equal(t, int64(0), ret.Block.Transactions[i].Operations[0].OperationIdentifier.Index)
assert.Equal(t, int64(1), ret.Block.Transactions[i].Operations[1].OperationIdentifier.Index)
assert.Equal(t, int64(2), ret.Block.Transactions[i].Operations[2].OperationIdentifier.Index)
assert.Equal(t, 2, len(ret.Block.Transactions[i].Operations[2].RelatedOperations))
assert.Equal(t, int64(0), ret.Block.Transactions[i].Operations[2].RelatedOperations[0].Index)
assert.Equal(t, int64(1), ret.Block.Transactions[i].Operations[2].RelatedOperations[1].Index)
assert.Equal(t, klaytn.CallOpType, ret.Block.Transactions[i].Operations[2].Type)
assert.Equal(t, klaytn.CallOpType, ret.Block.Transactions[i].Operations[3].Type)
assert.Equal(t, klaytn.CallOpType, ret.Block.Transactions[i].Operations[4].Type)
assert.Equal(t, int64(2), ret.Block.Transactions[i].Operations[2].OperationIdentifier.Index)
assert.Equal(t, int64(3), ret.Block.Transactions[i].Operations[3].OperationIdentifier.Index)
assert.Equal(t, int64(4), ret.Block.Transactions[i].Operations[4].OperationIdentifier.Index)
assert.Equal(t, 1, len(ret.Block.Transactions[i].Operations[4].RelatedOperations))
assert.Equal(t, int64(3), ret.Block.Transactions[i].Operations[4].RelatedOperations[0].Index)
assert.Equal(t, 1, len(ret.Block.Transactions[i].Operations[3].RelatedOperations))
assert.Equal(t, int64(2), ret.Block.Transactions[i].Operations[3].RelatedOperations[0].Index)
found = true
}
assert.True(t, found)
Expand Down Expand Up @@ -113,22 +108,15 @@ func TestBlockTransaction(t *testing.T) {
ret, err := blockAPIService.BlockTransaction(ctx, request)
assert.Nil(t, err)
assert.Equal(t, testTxHash, ret.Transaction.TransactionIdentifier.Hash)
assert.Equal(t, 5, len(ret.Transaction.Operations))
assert.Equal(t, 4, len(ret.Transaction.Operations))
assert.Equal(t, klaytn.FeeOpType, ret.Transaction.Operations[0].Type)
assert.Equal(t, klaytn.FeeOpType, ret.Transaction.Operations[1].Type)
assert.Equal(t, klaytn.FeeOpType, ret.Transaction.Operations[2].Type)
assert.Equal(t, int64(0), ret.Transaction.Operations[0].OperationIdentifier.Index)
assert.Equal(t, int64(1), ret.Transaction.Operations[1].OperationIdentifier.Index)
assert.Equal(t, int64(2), ret.Transaction.Operations[2].OperationIdentifier.Index)
assert.Equal(t, 2, len(ret.Transaction.Operations[2].RelatedOperations))
assert.Equal(t, int64(0), ret.Transaction.Operations[2].RelatedOperations[0].Index)
assert.Equal(t, int64(1), ret.Transaction.Operations[2].RelatedOperations[1].Index)
assert.Equal(t, klaytn.CallOpType, ret.Transaction.Operations[3].Type)
assert.Equal(t, klaytn.CallOpType, ret.Transaction.Operations[4].Type)
assert.Equal(t, int64(3), ret.Transaction.Operations[3].OperationIdentifier.Index)
assert.Equal(t, int64(4), ret.Transaction.Operations[4].OperationIdentifier.Index)
assert.Equal(t, 1, len(ret.Transaction.Operations[4].RelatedOperations))
assert.Equal(t, int64(3), ret.Transaction.Operations[4].RelatedOperations[0].Index)
assert.Equal(t, 1, len(ret.Transaction.Operations[3].RelatedOperations))
assert.Equal(t, int64(2), ret.Transaction.Operations[3].RelatedOperations[0].Index)
}

// Test /block/transaction with invalid data
Expand Down
2 changes: 1 addition & 1 deletion services/network_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (

var (
// rosetta-klaytn version
middlewareVersion = "1.0.4"
middlewareVersion = "1.0.5"

defaultNetworkOptions = &types.NetworkOptionsResponse{
Version: &types.Version{
Expand Down

0 comments on commit 702ded5

Please sign in to comment.