github.com/status-im/status-go@v1.1.0/services/wallet/thirdparty/mercuryo/request_currencies_test.go (about)

     1  package mercuryo
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/stretchr/testify/assert"
     7  )
     8  
     9  func TestUnmarshallCurrencies(t *testing.T) {
    10  	requiredAssetIDs := []CryptoCurrency{
    11  		{
    12  			Network:  "ETHEREUM",
    13  			Symbol:   "ETH",
    14  			Contract: "",
    15  		},
    16  		{
    17  			Network:  "OPTIMISM",
    18  			Symbol:   "ETH",
    19  			Contract: "",
    20  		},
    21  		{
    22  			Network:  "ARBITRUM",
    23  			Symbol:   "ETH",
    24  			Contract: "",
    25  		},
    26  		{
    27  			Network:  "ETHEREUM",
    28  			Symbol:   "DAI",
    29  			Contract: "0x6b175474e89094c44da98b954eedeac495271d0f",
    30  		},
    31  	}
    32  
    33  	currencies, err := handleCurrenciesResponse(getTestCurrenciesOKResponse())
    34  	assert.NoError(t, err)
    35  	assert.Subset(t, currencies, requiredAssetIDs)
    36  }