github.com/pokt-network/tendermint@v0.32.11-0.20230426215212-59310158d3e9/crypto/armor/armor_test.go (about)

     1  package armor
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  	"github.com/stretchr/testify/require"
     8  )
     9  
    10  func TestSimpleArmor(t *testing.T) {
    11  	blockType := "MINT TEST"
    12  	data := []byte("somedata")
    13  	armorStr := EncodeArmor(blockType, nil, data)
    14  
    15  	// Decode armorStr and test for equivalence.
    16  	blockType2, _, data2, err := DecodeArmor(armorStr)
    17  	require.Nil(t, err, "%+v", err)
    18  	assert.Equal(t, blockType, blockType2)
    19  	assert.Equal(t, data, data2)
    20  }