mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-07-04 12:03:43 +02:00
internal/api/make.go: remove "contract" api in favor for the new "atomic" name.
This commit is contained in:
parent
0f5fdedd91
commit
9109bef803
2 changed files with 4 additions and 24 deletions
|
|
@ -6,11 +6,10 @@ import (
|
||||||
|
|
||||||
func Make(name string, args ApiArguments) (ApiInterface, error) {
|
func Make(name string, args ApiArguments) (ApiInterface, error) {
|
||||||
factories := map[string]Factory{
|
factories := map[string]Factory{
|
||||||
"v1": EosioV1Factory,
|
"v1": EosioV1Factory,
|
||||||
"v2": EosioV2Factory,
|
"v2": EosioV2Factory,
|
||||||
"contract": AtomicAssetFactory,
|
"atomic": AtomicAssetFactory,
|
||||||
"atomic": AtomicAssetFactory,
|
"debug": DebugApiFactory,
|
||||||
"debug": DebugApiFactory,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if factory, ok := factories[name]; ok {
|
if factory, ok := factories[name]; ok {
|
||||||
|
|
|
||||||
|
|
@ -76,25 +76,6 @@ func TestParseRequest_EosioV2Full(t *testing.T) {
|
||||||
assert.Equal(t, expected.LogInfo(), api.LogInfo())
|
assert.Equal(t, expected.LogInfo(), api.LogInfo())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Old contract api (alias for backward compatibility)
|
|
||||||
// --------------------------------
|
|
||||||
|
|
||||||
func TestParseRequest_OldContract(t *testing.T) {
|
|
||||||
expected := api.NewAtomicAsset("http://api.contract.example.com", 5)
|
|
||||||
|
|
||||||
api, err := ParseRequest("contract|http://api.contract.example.com")
|
|
||||||
assert.NoError(t, err)
|
|
||||||
assert.Equal(t, expected.LogInfo(), api.LogInfo())
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestParseRequest_OldContractWithBlockTime(t *testing.T) {
|
|
||||||
expected := api.NewAtomicAsset("http://api.contract.example.com", 256)
|
|
||||||
|
|
||||||
api, err := ParseRequest("contract|http://api.contract.example.com|512")
|
|
||||||
assert.NoError(t, err)
|
|
||||||
assert.Equal(t, expected.LogInfo(), api.LogInfo())
|
|
||||||
}
|
|
||||||
|
|
||||||
// AtomicAsset
|
// AtomicAsset
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue