InjectiveLabs/sdk-go

sdk go install shows wasmvm undefined types (gasmeter, gas...)

Closed this issue · 2 comments

Hi everyone,

When I install the sdk-go package :
go install ./...

I show me the following errors :

github.com/ethereum/go-ethereum/crypto/secp256k1: build constraints exclude all Go files in /go/pkg/mod/github.com/ethereum/go-ethereum@v1.9.25/crypto/secp256k1

github.com/CosmWasm/wasmvm/api

/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:192:2: undefined: GasMeter
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:193:20: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:197:11: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:198:11: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:202:28: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:209:38: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:213:32: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:227:42: undefined: Gas
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:326:7: undefined: KVStore
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mock_failure.go:15:27: undefined: GoAPI
/go/pkg/mod/github.com/!cosm!wasm/wasmvm@v1.0.0/api/mocks.go:326:7: too many errors

In this version v1.0.0, these types are in api/callbacks.go

The solution is to change the default arg CGO_ENABLED from "0" to "1" when invoking buildGoApplication

@achilleas-kal found the solution,
Btw sdk-go is designed as a library to interact with injective chain, use go get .... Close this as we don't have any further discussion, feel free to open if the issue pops up