warp-contracts / warp-wasm-templates

Templates for WASM smart contracts (AS, Rust, Go) compatible with SmartWeave Protocol
41 stars 6 forks source link

Issue deploying go template #13

Open hyukudan opened 2 years ago

hyukudan commented 2 years ago

I've been having problems deploying the Go template, without making any change to the source code and fully following the tutorial to test it. I cloned the repositories, installed the dependencies indicated in the readme (go 1.17, I also tried with go 1.17.13 and had the same problem, and Tinygo 0.25.0).

The code compiles without any error, same with generate, but I'm not able to deploy (tried both in local and testnet) after following what is written down, and it seems to come from wasm2json.

json.push(sectionParsers[header.name](stream, header)) ^

TypeError: sectionParsers[header.name] is not a function

at Function._exports.parse (warp-wasm-templates/go/node_modules/redstone-wasm-json-toolkit/wasm2json.js:614:42) at Object.module.exports [as wasm2json] (warp-wasm-templates/go/node_modules/redstone-wasm-json-toolkit/wasm2json.js:7:19) at Object.exports.meterWASM (warp-wasm-templates/go/node_modules/redstone-wasm-metering/index.js:227:22) at SourceImpl.save (warp-wasm-templates/go/node_modules/warp-contracts/lib/cjs/contract/deploy/impl/SourceImpl.js:36:72) at DefaultCreateContract.deploy (warp-wasm-templates/go/node_modules/warp-contracts/lib/cjs/contract/deploy/impl/DefaultCreateContract.js:17:36) at module.exports.deploy (warp-wasm-templates/go/deploy/scripts/deploy.js:26:50) at processTicksAndRejections (node:internal/process/task_queues:96:5)

ppedziwiatr commented 2 years ago

@asiaziola , can you please take a look? I belive the integration tests for Go in our warp sdk repo work correctly...

ppedziwiatr commented 2 years ago

Also, I'm not sure whether we should continue to support the Go version...Go's implementation of WASM is rather weird + issues with binary size on a standard go compiler + issues with basic features (like serialization - https://github.com/tinygo-org/tinygo/issues/447) on a tinygo compiler...