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 missing fee and hash functions #28

Merged
merged 43 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
480fc25
bump: csl to 13.2
rmgaray Dec 11, 2024
0d3e5de
add TransactionUnspentOutput(s) util classes
rmgaray Dec 11, 2024
a03160b
fix: new() method for ConstrPlutusData
rmgaray Dec 17, 2024
4e814f5
fix: field names to match CSL names
rmgaray Dec 18, 2024
f2cfca4
fix: strip spaces begging/end of cbor files
rmgaray Dec 18, 2024
88a13d6
fix: children of tagged records throwing an error because they don't …
rmgaray Dec 18, 2024
d5763f8
add TX with PoolParams to regression suite
rmgaray Dec 18, 2024
26b027d
fix: missing CBOR wrapper in (de)serialization of ScriptRef
rmgaray Dec 20, 2024
046aa1d
move hardcoded blacklists to class-info.json & add new blacklist with…
rmgaray Dec 20, 2024
54d207e
fix: wrong array tag header when serializing Credential
rmgaray Dec 20, 2024
0eae36f
fix: readNullable not consuming null values
rmgaray Dec 20, 2024
80c0317
add `minAdaForOutput` function
marcusbfs Nov 1, 2024
dbb5ab5
add fee and hash functions
marcusbfs Nov 10, 2024
dae7770
fix import path
marcusbfs Nov 10, 2024
f753bb5
use `BigInt` instead of `BigNum` for `Fraction`
marcusbfs Nov 19, 2024
9cd607b
fix `min_fee` test.
marcusbfs Nov 19, 2024
b6dfd14
add `min_output_ada` test
marcusbfs Nov 19, 2024
d5bf608
add polyfill for webcrypto
marcusbfs Nov 26, 2024
690582b
move `base58` to dependency
marcusbfs Nov 26, 2024
9a03fcb
prepare package for publishing
marcusbfs Nov 26, 2024
3bf8213
fix type errors
marcusbfs Nov 27, 2024
1e09e43
prepend `@mlabs-haskell` to package name
marcusbfs Dec 4, 2024
b6c4cd8
use `from_hex` instead of `from_bytes` in test
marcusbfs Dec 4, 2024
b998aa9
fix `LinearFee` constructor parameters
marcusbfs Dec 4, 2024
f3ba940
add more tests to `min_fee`
marcusbfs Dec 4, 2024
4cfdb8d
fix `MinOutputAdaCalculator` PreBabbage/PostAlonzo paths
marcusbfs Dec 4, 2024
22ccc67
fix tests for `MinOutputAdaCalculator`
marcusbfs Dec 4, 2024
3f703b8
clean: remove garbage files
marcusbfs Dec 6, 2024
65d14ee
add .npmignore
marcusbfs Dec 9, 2024
9a43d35
fix `bech32` limit
marcusbfs Dec 12, 2024
6103666
fix: `bech32` decoding
marcusbfs Dec 12, 2024
7e75ecc
fix: `bech32` encoding
marcusbfs Dec 12, 2024
faa2d8a
add missing static `new` to addresses
marcusbfs Dec 14, 2024
78ddace
fix: add custom missing methods for `TransactionOutput`
marcusbfs Dec 14, 2024
caa512f
fix: add to/from_bech32 to `Address`
marcusbfs Dec 15, 2024
effd3d4
add `Constitution.new_with_script_hash`
marcusbfs Dec 16, 2024
5947eae
fix: handling datum for TransactionOutput
marcusbfs Dec 16, 2024
c77ccd5
fix: handling metadata and plutus script for `AuxiliaryData`
marcusbfs Dec 17, 2024
04a395d
add missing methods to `TransactionOutput`
marcusbfs Dec 17, 2024
b651933
fix: change `NativeScripts` type to `array`
marcusbfs Dec 18, 2024
6e9184f
update generated.ts
marcusbfs Jan 14, 2025
09400ac
add `dist/` to gitignore
marcusbfs Jan 14, 2025
371658d
add `FixedTransaction` to ignored classes
marcusbfs Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ shell.nix
blockfrost-mainnet.txt
tests/reports/
tests/serialization/staging
dist/
Empty file added .npmignore
Empty file.
4 changes: 2 additions & 2 deletions conway-cddl/codegen/generators/hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class GenHash extends CodeGeneratorBase {
"from_bech32",
(from_bech32) => `
static ${from_bech32}(bech_str: string): ${this.name} {
let decoded = bech32.decode(bech_str);
let decoded = bech32.decode(bech_str, Number.MAX_SAFE_INTEGER);
let words = decoded.words;
let bytesArray = bech32.fromWords(words);
let bytes = new Uint8Array(bytesArray);
Expand All @@ -68,7 +68,7 @@ export class GenHash extends CodeGeneratorBase {
${to_bech32}(prefix: string): string {
let bytes = this.to_bytes();
let words = bech32.toWords(bytes);
return bech32.encode(prefix, words);
return bech32.encode(prefix, words, Number.MAX_SAFE_INTEGER);
}`,
)}

Expand Down
9 changes: 8 additions & 1 deletion conway-cddl/codegen/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function main() {

let yamlDir = path.join(curDir, "..", "yaml");

let files = [path.join(yamlDir, "conway.yaml")];
let files = [path.join(yamlDir, "conway.yaml"), path.join(yamlDir, "utils.yaml")];

let customDir = path.join(yamlDir, "custom");

Expand Down Expand Up @@ -77,6 +77,13 @@ async function main() {
import {bech32} from "bech32";
import * as cdlCrypto from "./lib/bip32-ed25519";
import {Address, Credential, CredKind, RewardAddress} from "./address";
import {webcrypto} from "crypto";

// Polyfill the global "crypto" object if it doesn't exist
if (typeof globalThis.crypto === 'undefined') {
// @ts-expect-error: Assigning Node.js webcrypto to globalThis.crypto
globalThis.crypto = webcrypto;
}

function $$UN(id: string, ...args: any): any {
throw ("Undefined function: " + id);
Expand Down
Loading
Loading