-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v5.0.0 update * v5 for go modules * Add wallet_foreign_api client * NodeOwnerAPI Client * NodeOwnerAPI done * Full NodeForeignAPI client * Update gomod temp * Fix v4 v5
- Loading branch information
1 parent
eb169fb
commit 15e865d
Showing
55 changed files
with
2,122 additions
and
1,473 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright 2020 BlockCypher | ||
// | ||
// 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 api | ||
|
||
import ( | ||
"encoding/json" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestUnmarshalOutputType(t *testing.T) { | ||
coinbaseb := []byte(`"Coinbase"`) | ||
var inbound outputType | ||
if err := json.Unmarshal(coinbaseb, &inbound); err != nil { | ||
assert.Error(t, err) | ||
} | ||
assert.Equal(t, inbound, CoinbaseOutputType) | ||
|
||
transactionb := []byte(`"Transaction"`) | ||
var outbound outputType | ||
if err := json.Unmarshal(transactionb, &outbound); err != nil { | ||
assert.Error(t, err) | ||
} | ||
assert.Equal(t, outbound, TransactionOutputType) | ||
} | ||
|
||
func TestMarshalOutputType(t *testing.T) { | ||
coinbaseb, err := json.Marshal(CoinbaseOutputType) | ||
assert.Nil(t, err) | ||
assert.Equal(t, string(coinbaseb), "\"Coinbase\"") | ||
|
||
transactionb, err := json.Marshal(TransactionOutputType) | ||
assert.Nil(t, err) | ||
assert.Equal(t, string(transactionb), "\"Transaction\"") | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.