Skip to content

Commit

Permalink
chore: add export comment on Get
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Oct 31, 2021
1 parent 4d6167f commit 5439486
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/runtime/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const (

// v0.8 test API wasm
HOST_API_TEST_RUNTIME = "hostapi_runtime"
HOST_API_TEST_RUNTIME_FP = "/Users/eclesiojunior/w3f/eclesio-polkaspec/test/runtimes/hostapi/target/release/wbuild/hostapi-runtime/hostapi_runtime.compact.wasm"
HOST_API_TEST_RUNTIME_FP = "hostapi_runtime.compact.wasm"
HOST_API_TEST_RUNTIME_URL = "https://github.com/ChainSafe/polkadot-spec/blob/80fa2be272820731b5159e9dc2a3eec3cca02b4d/test/hostapi_runtime.compact.wasm?raw=true"

// v0.8 substrate runtime with modified name and babe C=(1, 1)
Expand Down
1 change: 1 addition & 0 deletions lib/runtime/offchain/httpset.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (p *Set) Remove(id int) {
p.reqs = append(p.reqs[:id], p.reqs[id+1:]...)
}

// Get returns a request or nil if request not found
func (p *Set) Get(id int) *http.Request {
if len(p.reqs) <= id {
return nil
Expand Down
12 changes: 6 additions & 6 deletions lib/runtime/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"io/ioutil"
"net/http"
"os"
"path"
"testing"

"github.com/ChainSafe/chaindb"
Expand Down Expand Up @@ -71,12 +72,11 @@ func GetRuntimeVars(targetRuntime string) (string, string) {

// GetAbsolutePath returns the completePath for a given targetDir
func GetAbsolutePath(targetDir string) string {
// dir, err := os.Getwd()
// if err != nil {
// panic("failed to get current working directory")
// }
// return path.Join(dir, targetDir)
return targetDir
dir, err := os.Getwd()
if err != nil {
panic("failed to get current working directory")
}
return path.Join(dir, targetDir)
}

// GetRuntimeBlob checks if the test wasm @testRuntimeFilePath exists and if not, it fetches it from @testRuntimeURL
Expand Down

0 comments on commit 5439486

Please sign in to comment.