Skip to content

Commit

Permalink
fix v3 offchain costs
Browse files Browse the repository at this point in the history
  • Loading branch information
michele-nuzzi committed Jul 15, 2024
1 parent ee2fe29 commit 7586868
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@harmoniclabs/cbor": "^1.3.0",
"@harmoniclabs/plutus-data": "^1.2.4",
"@harmoniclabs/cardano-costmodels-ts": "^1.1.0",
"@harmoniclabs/plutus-machine": "^2.0.0-dev2",
"@harmoniclabs/plutus-machine": "^2.0.0-dev3",
"@harmoniclabs/uplc": "^1.2.3",
"@harmoniclabs/cardano-ledger-ts": "^0.2.1",
"@harmoniclabs/plu-ts-offchain": "0.1.13-dev4",
Expand Down
8 changes: 4 additions & 4 deletions packages/offchain/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/offchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@harmoniclabs/cbor": "^1.3.0",
"@harmoniclabs/plutus-data": "^1.2.4",
"@harmoniclabs/cardano-costmodels-ts": "^1.1.0",
"@harmoniclabs/plutus-machine": "^2.0.0-dev2",
"@harmoniclabs/plutus-machine": "^2.0.0-dev3",
"@harmoniclabs/uplc": "^1.2.3",
"@harmoniclabs/cardano-ledger-ts": "^0.2.1"
},
Expand Down
9 changes: 9 additions & 0 deletions packages/offchain/src/__tests__/docs/docs.v3.hello.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { DataB } from "@harmoniclabs/plutus-data";
import { fromAscii, fromHex } from "@harmoniclabs/uint8array-utils";
import { defaultMainnetGenesisInfos, TxBuilder } from "../..";
import { defaultV3Costs } from "@harmoniclabs/cardano-costmodels-ts"
import { parseUPLC, showUPLC } from "@harmoniclabs/uplc";

test("Hello plu-ts",() => {

Expand All @@ -11,6 +12,12 @@ test("Hello plu-ts",() => {
fromHex("01010032323232323232322323259800800c5268b2ae686644b3001002800c5282ae693001329800991aba1357446ae8800400a003001800c0064601800300148888888c8cc966002600290004400e2b300130014800a20091598009800a400910058acc004c005200688034566002600290044401e2b300130014802a20111655cd1573455cd1573455cd15734370e6aae74004d55cf0009baa007134928ca6002e3e664664600e46ae80c0080040052f588eb8dd6191aba1357446ae88d5d11aba2357446ae88d5d11aba2001300435742005375c6ae84005222330093003001002244464664b300130014800220071598009800a400510048b2ae68ab9a1b8735573a0026aae78004dd500184cdc79bae300a0014890c48656c6c6f20706c752d7473003002001235573c6ea800488cc01484008888cc014008c00c0048cc00c852811119802980200109801800912cc00400a2946002ab9a18011111194c004c0100066006003002401866008006004444b3001001801c4cc008d5d08009aba2001555cf88c8c0088cc0080080048c0088cc0080080048d5d09aba200101")
);

console.log(
showUPLC(
parseUPLC( script.bytes ).body
)
);

const scriptAddr = Address.mainnet(
Credential.script( script.hash )
);
Expand Down Expand Up @@ -63,4 +70,6 @@ test("Hello plu-ts",() => {
changeAddress: myAddr
});

console.log( tx.body.fee );

})
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test("hello pluts", () => {
);
});

const compiled = compile( contract );
const compiled = compile( contract, [ 1, 0, 0 ] );

console.log( toHex( compiled ) );
});

0 comments on commit 7586868

Please sign in to comment.