Skip to content

Commit

Permalink
Minor cleanup from PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jan 21, 2021
1 parent f5a74df commit 31b125e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,20 @@ func TestAnalyzeCode(t *testing.T) {
// instantiate non-ibc contract
wasm, err := ioutil.ReadFile(HACKATOM_TEST_CONTRACT)
require.NoError(t, err)
id, err := vm.Create(wasm)
checksum, err := vm.Create(wasm)
require.NoError(t, err)
// and analyze
report, err := vm.AnalyzeCode(id)
report, err := vm.AnalyzeCode(checksum)
require.NoError(t, err)
require.False(t, report.HasIBCEntryPoints)

// instantiate ibc contract
wasm2, err := ioutil.ReadFile(IBC_TEST_CONTRACT)
require.NoError(t, err)
id2, err := vm.Create(wasm2)
checksum2, err := vm.Create(wasm2)
require.NoError(t, err)
// and analyze
report2, err := vm.AnalyzeCode(id2)
report2, err := vm.AnalyzeCode(checksum2)
require.NoError(t, err)
require.True(t, report2.HasIBCEntryPoints)
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ fn do_analyze_code(
let contract_checksum: Checksum = unsafe { contract_checksum.read() }
.ok_or_else(|| Error::empty_arg(CACHE_ARG))?
.try_into()?;
let wasm = cache.analyze(&contract_checksum)?;
Ok(wasm.into())
let report = cache.analyze(&contract_checksum)?;
Ok(report.into())
}

#[no_mangle]
Expand Down

0 comments on commit 31b125e

Please sign in to comment.