Skip to content

Commit

Permalink
Merge pull request #337 from sCrypt-Inc/oracle
Browse files Browse the repository at this point in the history
Update oracle demo data
  • Loading branch information
gitzhou authored Mar 27, 2024
2 parents df6cc45 + 76faf36 commit c0d9085
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tests/oracleDemoBsv20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ const PUBKEY = {
}
// https://api.witnessonchain.com/#/v1/V1Controller_getInscription
const RESP = {
timestamp: 1711511226,
timestamp: 1711554084,
outpoint:
'7972d872ae5cbd4fe1dd5912a7cef79745950bce38ba6f1df912ee1fe5952557_0',
'503021e05b44fc43f992b13a0e0d48ed68fc2a79e470937f6ffff5a910a15a5e_0',
fungible: 1,
amt: 10000,
id: '7972d872ae5cbd4fe1dd5912a7cef79745950bce38ba6f1df912ee1fe5952557_0',
data: '04ba96036600572595e51fee12f91d6fba38ce0b954597f7cea71259dde14fbd5cae72d8727900000000011027000000000000373937326438373261653563626434666531646435393132613763656637393734353935306263653338626136663164663931326565316665353935323535375f30',
amt: 100,
id: 'd5cf3e729e7f68f160dbad7cb3cec008127e5484484d68ba2dcebd3bbf9fa776_0',
data: '04243e0466005e5aa110a9f5ff6f7f9370e4792afc68ed480d0e3ab192f943fc445be021305000000000016400000000000000643563663365373239653766363866313630646261643763623363656330303831323765353438343438346436386261326463656264336262663966613737365f30',
signature: {
s: '80385ea550a64558f7d0146c7b7485b36044b20e2e291cb089864c80d344476657c291688c6459ce7037cb2ee8941c1b6176a2b9e46da429ba91564daadd72f2d5b2b9550cd0a9a78df8eda96905848fec8bfbf600dd2af2cd336b7b6d0615fe1e3ce41b7de3498fe0e0cd6e86d79c62199eea2eb514663ba8fabc3eaf6a603487c10465650b20c48b87fb5d0a1f913073f90eb2b0e9f56eb41b5518f76b8bb2cd7906c5bb0855d6f0a6fe5e6456c8a27e5868f36374733043e4cc0c6dd28e5e4cd0bdb3b7b76dbcfee5a7cfe4fc87404aa431058ef58dcf528ad0a37fc5f8ede5da557bdd0e4fc5007e4e2b502199fd794785e67e534c213ca73b0bb02bebc822cfe97b5fcbaebb45ebd875499e923b10af2d05db8ec5220afad9dd45eef04569ddb8f6bbf0e6cf53407387c87358b9ebdce084930239de1efdc130df4b05814ee22a8848436ce94b2b4d87643e0d24dd9d155dcd750f726f893763d56c530d57480a207c50ea7f165c9e33909354f340ceab752eac60d52dcc653a5ca0e23f',
padding: '0000000000000000',
s: 'f59720bb97826df3fe58e5bac09d1c0924d0b1c9fe93044276cae97da0450af31ddaed1cb805ac934172072514bbd2e2a85cf811a5c1971509617dcf4171484530c7e491d1a13b8b0b9ba013785a6f51ed0204afa6aefb98dcd616194a4bc95289ea7d3a7b7a8348f3205b8f0f95a00c4f17877a81c26a6ae48df7d064004accb530671dfcd9d5a0e0cc5ec26127de15477c66d963e90715961d01e73d3435a2d4c853065089f0fc899a2dd0826790d311696cb8ebc2901b6b4361b2275dcd351c85c1444a8f1f4254be3fdd5b4e63c617641e269dcd5eb00a0e5dc7a7c435118fb2cff5102a9d081545b387f5708e202f2943381741de045d27b87377f4bec9e99f64351ec478643d56638bd6fe8740aece764e1bd19ed37829dfc1fe2e607af2e5c394d2d3d10b9fedc916ed64ea715ac054a05769d7f55fa4576406fe2ce58ed2d9fc38bb87425edc101ead6fbadcfad06825992f2cb198dc0f8f9f20189a1cec0489a0ee7a9c7869b53f2f688e30514258c93ba702515ef61ef42d67af40',
padding: '00',
},
}

describe('Test SmartContract `OracleDemoBsv20`', () => {
// token utxo
const txid =
'7972d872ae5cbd4fe1dd5912a7cef79745950bce38ba6f1df912ee1fe5952557'
'503021e05b44fc43f992b13a0e0d48ed68fc2a79e470937f6ffff5a910a15a5e'
const vout = 0
const script =
'0063036f726451126170706c69636174696f6e2f6273762d3230004c747b2270223a226273762d3230222c226f70223a227472616e73666572222c226964223a22643563663365373239653766363866313630646261643763623363656330303831323765353438343438346436386261326463656264336262663966613737365f30222c22616d74223a22313030227d6876a914700cc86d386b5c4707c06c96985f57ca875266e988ac'
Expand All @@ -59,7 +59,10 @@ describe('Test SmartContract `OracleDemoBsv20`', () => {
OracleDemoBsv20.loadArtifact()
const rabinPubKey: RabinPubKey =
WitnessOnChainVerifier.parsePubKey(PUBKEY)
const inscriptionId = toByteString(`${txid}_${vout}`, true)
const inscriptionId = toByteString(
'd5cf3e729e7f68f160dbad7cb3cec008127e5484484d68ba2dcebd3bbf9fa776_0',
true
)
const amt = 10n
demoInstance = new OracleDemoBsv20(rabinPubKey, inscriptionId, amt)
await demoInstance.connect(signer)
Expand Down

0 comments on commit c0d9085

Please sign in to comment.