forked from hyperledger-archives/indy-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request hyperledger-archives#13 from hadleym/wrap-init
Wrap init
- Loading branch information
Showing
7 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as posix from 'path' | ||
import { CXSRuntime } from '../index' | ||
import { CXSRuntimeConfig } from '../rustlib' | ||
|
||
export function init_cxs (filename) { | ||
const config = new CXSRuntimeConfig(null) | ||
const rust = new CXSRuntime(config) | ||
return rust.ffi.cxs_init(filename) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { expect } from 'chai' | ||
import { describe, it } from 'mocha' | ||
import { init_cxs } from '../src/api/init' | ||
|
||
describe('cxs_init', () => { | ||
it ('should return 0 when given a null argument', () => { | ||
const result = init_cxs(null) | ||
expect(result).to.equal(0) | ||
}) | ||
it ('should return 1001 when given an invalid argument', () => { | ||
const result = init_cxs('garbage') | ||
expect(result).to.equal(1001) | ||
}) | ||
}) |