Skip to content

Commit

Permalink
update turing tests for mainnet (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
CAPtheorem authored Jun 15, 2022
1 parent 5aa7d5f commit 79c3b89
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/boba/turing/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config: HardhatUserConfig = {
accounts: ['0x0000000000000000000000000000000000000000000000000000000000000000']
},
boba_mainnet: {
url: 'http://3.238.204.142:8545',
url: 'http://mainnet.boba.network',
accounts: ['0x0000000000000000000000000000000000000000000000000000000000000000']
},
},
Expand Down
14 changes: 8 additions & 6 deletions packages/boba/turing/test/003_stable_swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const cfg = hre.network.config
const hPort = 1235 // Port for local HTTP server
var urlStr

const gasOverride = { gasLimit: 3000000 }
const gasOverride = { /*gasLimit: 3000000*/ }
const local_provider = new providers.JsonRpcProvider(cfg['url'])

const deployerPK = hre.network.config.accounts[0]
Expand Down Expand Up @@ -60,6 +60,8 @@ describe("Stableswap at AWS Lambda", function () {
(TuringHelperJson.abi),
(TuringHelperJson.bytecode),
deployerWallet)

console.log(" Factory__Helper", Factory__Helper)

helper = await Factory__Helper.deploy(gasOverride)
console.log(" Helper contract deployed as", helper.address)
Expand Down Expand Up @@ -90,8 +92,8 @@ describe("Stableswap at AWS Lambda", function () {
BobaTuringCreditAddress = '0x208c3CE906cd85362bd29467819d3AcbE5FC1614'
}
else if(hre.network.name === 'boba_mainnet') {
BOBAL2Address = '0x_______________'
BobaTuringCreditAddress = '0x_______________________'
BOBAL2Address = '0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7'
BobaTuringCreditAddress = '0xF8D2f1b0292C0Eeef80D8F47661A9DaCDB4b23bf'
}
else {
const result = await request.get({ uri: 'http://127.0.0.1:8080/boba-addr.json' })
Expand All @@ -106,6 +108,9 @@ describe("Stableswap at AWS Lambda", function () {
deployerWallet
)

const bobaBalance = await L2BOBAToken.balanceOf(deployerWallet.address)
console.log(" BOBA Balance in your account", bobaBalance.toString())

// prepare to register/fund your Turing Helper
turingCredit = getContractFactory(
'BobaTuringCredit',
Expand All @@ -129,9 +134,6 @@ describe("Stableswap at AWS Lambda", function () {

const preBalance = await turingCredit.prepaidBalance(helper.address)

const bobaBalance = await L2BOBAToken.balanceOf(deployerWallet.address)
console.log(" BOBA Balance in your account", bobaBalance.toString())

const approveTx = await L2BOBAToken.approve(
turingCredit.address,
depositAmount
Expand Down
11 changes: 6 additions & 5 deletions packages/boba/turing/test/004_random_256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ import * as request from 'request-promise-native'
const fetch = require('node-fetch')
import hre from 'hardhat'
const cfg = hre.network.config
const hPort = 1235 // Port for local HTTP server
var urlStr

const gasOverride = { gasLimit: 3000000 }
const gasOverride = { /*gasLimit: 3000000*/ }
const local_provider = new providers.JsonRpcProvider(cfg['url'])

const deployerPK = hre.network.config.accounts[0]
Expand Down Expand Up @@ -64,8 +62,8 @@ describe("Turing 256 Bit Random Number", function () {
BobaTuringCreditAddress = '0x208c3CE906cd85362bd29467819d3AcbE5FC1614'
}
else if(hre.network.name === 'boba_mainnet') {
BOBAL2Address = '0x______________________________'
BobaTuringCreditAddress = '0x______________________________'
BOBAL2Address = '0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7'
BobaTuringCreditAddress = '0xF8D2f1b0292C0Eeef80D8F47661A9DaCDB4b23bf'
}
else {
const result = await request.get({ uri: 'http://127.0.0.1:8080/boba-addr.json' })
Expand All @@ -80,6 +78,9 @@ describe("Turing 256 Bit Random Number", function () {
deployerWallet
)

const bobaBalance = await L2BOBAToken.balanceOf(deployerWallet.address)
console.log(" BOBA Balance in your account", bobaBalance.toString())

// prepare to register/fund your Turing Helper
turingCredit = getContractFactory(
'BobaTuringCredit',
Expand Down
11 changes: 6 additions & 5 deletions packages/boba/turing/test/005_lending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ chai.use(solidity)
const abiDecoder = require('web3-eth-abi')
import * as request from 'request-promise-native'

const fetch = require('node-fetch')
import hre from 'hardhat'
const cfg = hre.network.config
const hPort = 1235 // Port for local HTTP server
var urlStr

const gasOverride = { gasLimit: 3000000 }
const gasOverride = { /*gasLimit: 3000000*/ }
const local_provider = new providers.JsonRpcProvider(cfg['url'])

const deployerPK = hre.network.config.accounts[0]
Expand Down Expand Up @@ -82,8 +80,8 @@ describe("Pull Bitcoin - USD quote", function () {
BobaTuringCreditAddress = '0x208c3CE906cd85362bd29467819d3AcbE5FC1614'
}
else if(hre.network.name === 'boba_mainnet') {
BOBAL2Address = '0x_________________'
BobaTuringCreditAddress = '0x___________________'
BOBAL2Address = '0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7'
BobaTuringCreditAddress = '0xF8D2f1b0292C0Eeef80D8F47661A9DaCDB4b23bf'
}
else {
const result = await request.get({ uri: 'http://127.0.0.1:8080/boba-addr.json' })
Expand All @@ -98,6 +96,9 @@ describe("Pull Bitcoin - USD quote", function () {
deployerWallet
)

const bobaBalance = await L2BOBAToken.balanceOf(deployerWallet.address)
console.log(" BOBA Balance in your account", bobaBalance.toString())

// prepare to register/fund your Turing Helper
turingCredit = getContractFactory(
'BobaTuringCredit',
Expand Down
10 changes: 6 additions & 4 deletions packages/boba/turing/test/006_NFT_random.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ chai.use(solidity)
const abiDecoder = require('web3-eth-abi')
import * as request from 'request-promise-native'

const fetch = require('node-fetch')
import hre from 'hardhat'
const cfg = hre.network.config

const gasOverride = { gasLimit: 3000000 }
const gasOverride = { /*gasLimit: 3000000*/ }

import ERC721Json from "../artifacts/contracts/ERC721min.sol/ERC721min.json"
import TuringHelperJson from '@boba/turing-hybrid-compute/artifacts/contracts/TuringHelper.sol/TuringHelper.json'
Expand Down Expand Up @@ -72,8 +71,8 @@ describe("Turing NFT Random 256", function () {
BobaTuringCreditAddress = '0x208c3CE906cd85362bd29467819d3AcbE5FC1614'
}
else if(hre.network.name === 'boba_mainnet') {
BOBAL2Address = '0x________________'
BobaTuringCreditAddress = '0x________________'
BOBAL2Address = '0xa18bF3994C0Cc6E3b63ac420308E5383f53120D7'
BobaTuringCreditAddress = '0xF8D2f1b0292C0Eeef80D8F47661A9DaCDB4b23bf'
}
else {
const result = await request.get({ uri: 'http://127.0.0.1:8080/boba-addr.json' })
Expand All @@ -88,6 +87,9 @@ describe("Turing NFT Random 256", function () {
deployerWallet
)

const bobaBalance = await L2BOBAToken.balanceOf(deployerWallet.address)
console.log(" BOBA Balance in your account", bobaBalance.toString())

// prepare to register/fund your Turing Helper
turingCredit = getContractFactory(
'BobaTuringCredit',
Expand Down

0 comments on commit 79c3b89

Please sign in to comment.