Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 649 Bytes

LocalContext.md

File metadata and controls

37 lines (25 loc) · 649 Bytes

LocalContext 用于本地模拟环境测试 的一些使用场景

  1. 向 address1 发放 1 个 NAS
LocalContext.transfer(null, address1, new BigNumber(10).pow(18))
  1. address1 向 address2 发放 1 个 NAS
LocalContext.transfer(address1, address2, new BigNumber(10).pow(18))
  1. 获取某地址余额
LocalContext.getBalance(address)
  1. 获取某合约地址
LocalContext.getContractAddress(Contract1)
  1. 设置当前区块高度
LocalContext.blockHeight = 1
  1. 清除本地模拟环境数据
LocalContext.clearData()