Skip to content

Commit

Permalink
Merge pull request #48 from sikkatech/sunny/46
Browse files Browse the repository at this point in the history
remove http request in validatebasic
  • Loading branch information
ethanfrey committed Jan 23, 2020
2 parents 877c24d + 348a123 commit 7c9b480
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
14 changes: 0 additions & 14 deletions x/wasm/genesis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ func TestInitGenesis(t *testing.T) {
res = h(data.ctx, msg)
require.False(t, res.IsOK())

t.Log("fail with unreachable source url")
msg = MsgStoreCode{
Sender: creator,
WASMByteCode: testContract,
Source: "https://github.com/cosmwasm/wasmddddddrandom",
Builder: "",
}

sdkerr = msg.ValidateBasic()
require.Error(t, sdkerr)

res = h(data.ctx, msg)
require.False(t, res.IsOK())

t.Log("fail with invalid build tag")
msg = MsgStoreCode{
Sender: creator,
Expand Down
7 changes: 0 additions & 7 deletions x/wasm/internal/types/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package types

import (
"encoding/json"
"net/http"
"net/url"
"regexp"

Expand Down Expand Up @@ -50,12 +49,6 @@ func (msg MsgStoreCode) ValidateBasic() sdk.Error {
if !u.IsAbs() {
return sdk.ErrInternal("source should be an absolute url")
}

// check if the source is reachable
resp, err := http.Get(msg.Source)
if err != nil || resp.StatusCode != 200 {
return sdk.ErrInternal("source url is not reachable")
}
}

if msg.Builder != "" {
Expand Down

0 comments on commit 7c9b480

Please sign in to comment.