Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Sacc.sol #170

Merged
merged 1 commit into from
May 17, 2022
Merged

Add Sacc.sol #170

merged 1 commit into from
May 17, 2022

Conversation

leo201313
Copy link
Contributor

Sacc.sol

为fabric的chaincode示例sacc.go的solidity实现。

部署

使用WeCross-Demo中的混合场景进行合约部署。将Sacc.go放在WeCross-Console的conf/contracts/solidity下。

  • 首先使用login org1-admin 123456登入跨链账户。
  • 输入bcosDeploy payment.bcos-gm.sacc contracts/solidity/Sacc.sol SimpleAsset 1.0 Leo 9999,注意最后两个参数为合约的初始参数,即设置键值Leo为9999。
  • listResources输出已部署资源如下。
[WeCross.org1-admin]> listResources 
path: payment.bcos-gm.HelloWorld, type: GM_BCOS2.0, distance: 1
path: payment.bcos-gm.WeCrossHub, type: GM_BCOS2.0, distance: 1
path: payment.bcos-gm.sacc, type: GM_BCOS2.0, distance: 1
path: payment.bcos-group1.HelloWorldGroup1, type: BCOS2.0, distance: 0
path: payment.bcos-group1.WeCrossHub, type: BCOS2.0, distance: 0
path: payment.bcos-group2.HelloWorldGroup2, type: BCOS2.0, distance: 0
path: payment.bcos-group2.WeCrossHub, type: BCOS2.0, distance: 0
path: payment.fabric-mychannel.WeCrossHub, type: Fabric1.4, distance: 1
path: payment.fabric-mychannel.sacc, type: Fabric1.4, distance: 1
total: 9

测试

  • login
  • call payment.bcos-gm.sacc get Leo >> Result : [9999]
  • sendTransaction payment.bcos-gm.sacc set Thea 100 >> Result : [100]
  • call payment.bcos-gm.sacc get Thea >> Result : [100]
  • sendTransaction payment.bcos-gm.sacc set Leo 0 >> Result : [0]
  • call payment.bcos-gm.sacc get Leo >> Result : [0]

@codecov-commenter
Copy link

Codecov Report

Merging #170 (9643e19) into dev (87c6452) will increase coverage by 0.00%.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##               dev    #170   +/-   ##
=======================================
  Coverage     5.58%   5.59%           
  Complexity      35      35           
=======================================
  Files           22      22           
  Lines         2077    2074    -3     
  Branches       269     268    -1     
=======================================
  Hits           116     116           
+ Misses        1938    1935    -3     
  Partials        23      23           
Impacted Files Coverage Δ
...ava/com/webank/wecross/console/common/Version.java 0.00% <ø> (ø)
...ava/com/webank/wecross/console/routine/XAImpl.java 0.00% <0.00%> (ø)
...rc/main/java/com/webank/wecross/console/Shell.java 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5d137d4...9643e19. Read the comment docs.

@JimmyShi22
Copy link
Collaborator

👍 Accept!

@JimmyShi22 JimmyShi22 merged commit d70ec54 into WeBankBlockchain:dev May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants