mirror of https://github.com/certusone/wasmd.git
Merge pull request #48 from sikkatech/sunny/46
remove http request in validatebasic
This commit is contained in:
commit
7c9b48071a
|
@ -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,
|
||||
|
|
|
@ -2,7 +2,6 @@ package types
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"regexp"
|
||||
|
||||
|
@ -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 != "" {
|
||||
|
|
Loading…
Reference in New Issue