Skip to content

Commit

Permalink
Fix unchecked nils
Browse files Browse the repository at this point in the history
  • Loading branch information
masihyeganeh committed Oct 24, 2024
1 parent 2ad1eba commit 3a93383
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion integration-tests/modules/assetft_extension_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ func TestAssetFTExtensionWhitelist(t *testing.T) {
chain.TxFactoryAuto(),
msg,
)
requireT.NotEqualValues(chain.GasLimitByMsgs(msg), res.GasUsed)
requireT.NoError(err)
requireT.NotEqualValues(chain.GasLimitByMsgs(msg), res.GasUsed)

// Issue the new fungible token without extension
subunit = "uabe"
Expand Down
12 changes: 6 additions & 6 deletions integration-tests/modules/wasm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1985,11 +1985,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) {

dataBytes, err := codectypes.NewAnyWithValue(&assetnfttypes.DataBytes{Data: data})
// we need to do this, otherwise assertion fails because some private fields are set differently
requireT.NoError(err)
dataToCompare := &codectypes.Any{
TypeUrl: dataBytes.TypeUrl,
Value: dataBytes.Value,
}
requireT.NoError(err)

classID := assetnfttypes.BuildClassID(
issueClassReqNoWhitelist.Symbol,
Expand Down Expand Up @@ -2101,11 +2101,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) {
Data: []byte("mutable_data"),
}}})

requireT.NoError(err)
dataToCompare = &codectypes.Any{
TypeUrl: dataBytes.TypeUrl,
Value: dataBytes.Value,
}
requireT.NoError(err)

requireT.Equal(dataToCompare, nftResp.Nft.Data)

Expand Down Expand Up @@ -2134,11 +2134,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) {
Data: []byte("edited_data_by_admin"),
}}})

requireT.NoError(err)
dataToCompare = &codectypes.Any{
TypeUrl: dataBytes.TypeUrl,
Value: dataBytes.Value,
}
requireT.NoError(err)

nftResp, err = nftClient.NFT(ctx, &nfttypes.QueryNFTRequest{
ClassId: classIDNoWhitelist,
Expand Down Expand Up @@ -2183,11 +2183,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) {
Data: []byte("edited_data_by_owner"),
}}})

requireT.NoError(err)
dataToCompare = &codectypes.Any{
TypeUrl: dataBytes.TypeUrl,
Value: dataBytes.Value,
}
requireT.NoError(err)

nftResp, err = nftClient.NFT(ctx, &nfttypes.QueryNFTRequest{
ClassId: classIDNoWhitelist,
Expand Down Expand Up @@ -2333,11 +2333,11 @@ func TestWASMNonFungibleTokenInContract(t *testing.T) {
requireT.NoError(err)

dataBytes, err = codectypes.NewAnyWithValue(&assetnfttypes.DataBytes{Data: data})
requireT.NoError(err)
dataToCompare = &codectypes.Any{
TypeUrl: dataBytes.TypeUrl,
Value: dataBytes.Value,
}
requireT.NoError(err)

expectedNFT1 := &nfttypes.NFT{
ClassId: classID,
Expand Down Expand Up @@ -2573,11 +2573,11 @@ func TestWASMNonFungibleTokenInContractLegacy(t *testing.T) {

dataBytes, err := codectypes.NewAnyWithValue(&assetnfttypes.DataBytes{Data: data})
// we need to do this, otherwise assertion fails because some private fields are set differently
requireT.NoError(err)
dataToCompare := &codectypes.Any{
TypeUrl: dataBytes.TypeUrl,
Value: dataBytes.Value,
}
requireT.NoError(err)

expectedClass := assetnfttypes.Class{
Id: classID,
Expand Down

0 comments on commit 3a93383

Please sign in to comment.