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

Add a new asserter client with ignoring rosetta spec validation. #502

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions asserter/asserter.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,9 @@ func NewClientWithOptions(
return asserter, nil
}

// NewClientWithoutRosettaSpec constructs a new Asserter using the provided
// NewGenericRosettaClient constructs a new Asserter using the provided
// arguments and without a Rosetta Spec validation. This is used to ignore rosetta spec validation
func NewClientWithoutRosettaSpec(
func NewGenericRosettaClient(
network *types.NetworkIdentifier,
genesisBlockIdentifier *types.BlockIdentifier,
) (*Asserter, error) {
Expand Down Expand Up @@ -325,12 +325,8 @@ func NewClientWithoutRosettaSpec(
ignoreRosettaSpecValidation: true,
}

asserter.operationStatusMap = map[string]bool{}
asserter.operationStatusMap["SUCCESS"] = true
asserter.operationStatusMap["OK"] = true
asserter.operationStatusMap["COMPLETED"] = true
asserter.operationStatusMap["FAILED"] = false
asserter.operationStatusMap["FAILURE"] = false
//init default operation statuses for generic rosetta client
InitOperationStatus(asserter)

return asserter, nil
}
Expand Down
34 changes: 34 additions & 0 deletions asserter/operation_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Copyright 2020 Coinbase, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

2024???

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from what I saw, we have never changed copyright in asserter last 4 years. only those files in types, client, and server directories have been changed every year.

but anyway, I just changed all files which have copyright 2020.

//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package asserter

const (
OperationStatusSuccess = "SUCCESS"
OperationStatusOk = "OK"
OperationStatusCompleted = "COMPLETED"
OperationStatusFailed = "FAILED"
OperationStatusFailure = "FAILURE"
)

// InitOperationStatus initializes operation status map for a generic rosetta client
func InitOperationStatus(asserter *Asserter) {
asserter.operationStatusMap = map[string]bool{
OperationStatusSuccess: true,
OperationStatusOk: true,
OperationStatusCompleted: true,
OperationStatusFailed: false,
OperationStatusFailure: false,
}
}
Loading