Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

chain: Wireup go-owasm with blockchain properly #1934

Merged
merged 17 commits into from
Jun 23, 2020
Merged

Conversation

taobun
Copy link
Member

@taobun taobun commented Jun 11, 2020

fixed #1868

@taobun taobun requested review from sorawit, Benzbeeb and perimeko June 11, 2020 09:18
@render
Copy link

render bot commented Jun 11, 2020

@render
Copy link

render bot commented Jun 11, 2020

Your Render PR Server at https://d3n-scan-pr-1934.onrender.com is now live!

View it on your dashboard at https://dashboard.render.com/static/srv-brgvdkh8vr2di7lo9ob0.

@taobun taobun force-pushed the compile-oracle-script branch from 0daf736 to 65fe57b Compare June 12, 2020 06:39
@render
Copy link

render bot commented Jun 12, 2020

Your Render PR Server at https://d3n-scan-pr-1934.onrender.com is now live!

View it on your dashboard at https://dashboard.render.com/static/srv-brgvdkh8vr2di7lo9ob0.

@render
Copy link

render bot commented Jun 12, 2020

Your Render PR Server at https://d3n-scan-pr-1934.onrender.com is now live!

View it on your dashboard at https://dashboard.render.com/static/srv-brgvdkh8vr2di7lo9ob0.

@render
Copy link

render bot commented Jun 12, 2020

Your Render PR Server at https://d3n-scan-pr-1934.onrender.com is now live!

View it on your dashboard at https://dashboard.render.com/static/srv-brgvdkh8vr2di7lo9ob0.

Copy link
Member

@sorawit sorawit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add validate basic to ensure that you can't create do-not-modify data sources or oracle scripts.

@taobun taobun requested a review from sorawit June 22, 2020 12:30
}

func mustGetOwasmCode(filename string) []byte {
absPath, _ := filepath.Abs(fmt.Sprintf("../../pkg/owasm/res/%s", filename))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move out of this legacy pkg/owasm. We can create testfiles folder in x/oracle

@@ -66,14 +68,19 @@ func getTestDataSource(executable string) (ds types.DataSource, clear func()) {
}

func getTestOracleScript() (os types.OracleScript, clear func()) {
absPath, _ := filepath.Abs("../../../pkg/owasm/res/beeb.wasm")
code, err := ioutil.ReadFile(absPath)
absPath, _ := filepath.Abs("../../../pkg/owasm/res/beeb.wat")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

@@ -41,6 +41,7 @@ var (
ErrCreateWithDoNotModify = sdkerrors.Register(ModuleName, 34, "create with [do-not-modify] content")
ErrSelfReferenceAsReporter = sdkerrors.Register(ModuleName, 35, "cannot reference self as reporter")
ErrOBIDecode = sdkerrors.Register(ModuleName, 36, "cannot obi decode")
ErrCompileFailed = sdkerrors.Register(ModuleName, 37, "owasm compile failed")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ErrOwasmCompilation ... owasm compilation failed

chain/x/oracle/handler_test.go Outdated Show resolved Hide resolved
chain/pkg/owasm/res/edited_beeb.wat Outdated Show resolved Hide resolved
chain/pkg/owasm/res/edited_beeb.wat Outdated Show resolved Hide resolved
chain/pkg/owasm/res/edited_beeb.wat Outdated Show resolved Hide resolved
chain/pkg/owasm/res/edited_beeb.wat Outdated Show resolved Hide resolved
@Benzbeeb Benzbeeb force-pushed the compile-oracle-script branch from 455c4fc to 86b7d64 Compare June 23, 2020 09:57
chain/x/oracle/handler_test.go Outdated Show resolved Hide resolved
chain/x/oracle/handler_test.go Outdated Show resolved Hide resolved
@Benzbeeb Benzbeeb force-pushed the compile-oracle-script branch from a4e40c6 to 1303625 Compare June 23, 2020 11:37
@sorawit sorawit merged commit 625949e into master Jun 23, 2020
@sorawit sorawit deleted the compile-oracle-script branch June 23, 2020 12:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wireup go-owasm with blockchain properly
3 participants