Skip to content

Commit

Permalink
fix hyperlane gas tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rsoeldner committed Mar 27, 2024
1 parent 4245018 commit 1af7316
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
25 changes: 0 additions & 25 deletions docs/en/pact-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1833,31 +1833,6 @@ pact> (poseidon-hash-hack-a-chain 1 2 3 4 5 6 7 8)
18604317144381847857886385684060986177838410221561136253933256952257712543953
```

## Hyperlane {#Hyperlane}

### hyperlane-decode-token-message {#hyperlane-decode-token-message}

*x* `string` *→* `object:*`


Decode a base-64-unpadded encoded Hyperlane Token Message into an object `{recipient:GUARD, amount:DECIMAL, chainId:STRING}`.
```lisp
pact> (hyperlane-decode-token-message "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAewAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGF7InByZWQiOiAia2V5cy1hbGwiLCAia2V5cyI6WyJkYTFhMzM5YmQ4MmQyYzJlOTE4MDYyNmEwMGRjMDQzMjc1ZGViM2FiYWJiMjdiNTczOGFiZjZiOWRjZWU4ZGI2Il19AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")
{"amount": 0.000000000000000123,"chainId": "4","recipient": KeySet {keys: [da1a339bd82d2c2e9180626a00dc043275deb3ababb27b5738abf6b9dcee8db6],pred: keys-all}}
```


### hyperlane-message-id {#hyperlane-message-id}

*x* `object:*` *→* `string`


Get the Message Id of a Hyperlane Message object.
```lisp
pact> (hyperlane-message-id {"destinationDomain": 1,"nonce": 325,"originDomain": 626,"recipient": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F","sender": "0x6b622d746f6b656e2d726f75746572","tokenMessage": {"amount": 10000000000000000000.0,"recipient": "0x71C7656EC7ab88b098defB751B7401B5f6d8976F"},"version": 1})
"0x97d98aa7fdb548f43c9be37aaea33fca79680247eb8396148f1df10e6e0adfb7"
```

## REPL-only functions {#repl-lib}

The following functions are loaded automatically into the interactive REPL, or within script files with a `.repl` extension. They are not available for blockchain-based execution.
Expand Down
4 changes: 3 additions & 1 deletion src/Pact/GasModel/GasTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ import Pact.JSON.Legacy.Value

-- | Gas benchmark tests for Pact native functions
allNatives :: [NativeDefName]
allNatives = map fst (concatMap snd natives) <> nonNatives
allNatives = defNatives <> nonNatives
where
defNatives = map fst (concatMap snd $ hyperlaneDefs:natives)

-- | Non-native concepts to benchmark
nonNatives :: [NativeDefName]
Expand Down
1 change: 1 addition & 0 deletions src/Pact/Native.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module Pact.Native
, pactVersionDef
, formatDef
, strToIntDef
, hyperlaneDefs
, strToListDef
, concatDef
, intToStrDef
Expand Down

0 comments on commit 1af7316

Please sign in to comment.