Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Releases: txtx/txtx

v0.5.2

09 Oct 19:03

Choose a tag to compare

chore(release): bump crates and publish v0.5.2

v0.5.1

29 Sep 14:11
525ba52

Choose a tag to compare

Fix/cheatcode-deployment (#340)

* fix(svm): if cheatcode deployment, don't require keypair

* chore(addons/kit/core): add auth_ctx to action execution

* feat(svm-core): add cheatcode to deploy program

* chore: bump crates

* chore(svm): update squads signer language

* update docs

* chore(release): publish v0.5.1

v0.5.0

19 Sep 21:19

Choose a tag to compare

chore(release): publish v0.5.0

v0.4.3

16 Jul 16:51

Choose a tag to compare

What's Changed

Full Changelog: v0.4.2...v0.4.3

v0.4.2

12 Jul 02:09

Choose a tag to compare

chore(release): v0.4.2

v0.4.1

04 Jul 15:56

Choose a tag to compare

chore(release): publish v0.4.1

v0.4.0

04 Jul 15:25

Choose a tag to compare

chore(release): publish v0.4.0

v0.3.1

14 Jun 01:52

Choose a tag to compare

What's Changed

  • feat(svm-core): add create_class & create_record solana record service commands by @MicaiahReid in #289

Full Changelog: v0.3.0...v0.3.1

v0.3.0

13 Jun 15:57

Choose a tag to compare

Introducing Pre/Post Conditions 🎉

With the new Pre/Post Conditions feature in the tx-lang, any runbook action can assert some state before or after an action is executed. You can set the behavior for if the assertion doesn't pass. This allows you to configure retries, log some unexpected states, or stop execution if necessary. Here are a few examples.

Halt if some endpoint isn't up

On an action that fetches an endpoint, a post condition can be used to halt runbook execution if the endpoint isn't up. This example will retry executing the action up to 2 times if the assertion isn't true. The assertion checks that the action's status_code output equals 200. If the assertion isn't true after 2 retries, an error will be logged and execution will halt.

action "get_endpoint" "std::send_http_instruction" {
    url = "https://example.com"
    post_condition {
        retries = 2
        assertion = std::assert_eq(action.get_endpoint.status_code, 200)
        behavior = "halt" // this is the default behavior and can be ommitted
    }
}

Log if some endpoint isn't up

If we want to take the same action, but have it simply log if the assertion doesn't pass, we can do that too:

action "get_endpoint" "std::send_http_instruction" {
    url = "https://example.com"
    post_condition {
        retries = 2
        assertion = std::assert_eq(action.get_endpoint.status_code, 200)
        behavior = "log"
    }
}

Skip downstream actions if some endpoint isn't up

Or, if we want to skip downstream actions but proceed with runbook execution, we can do that too:

action "get_endpoint" "std::send_http_instruction" {
    url = "https://example.com"
    post_condition {
        retries = 2
        assertion = std::assert_eq(action.get_endpoint.status_code, 200)
        behavior = "skip"
    }
}

// skipped if assertion isn't true
output "result" {
    variable = action.get_endpoint.result
}

Use Preconditions to skip just one action downstream from another

action "get_endpoint" "std::send_http_instruction" {
    url = "https://example.com"
}

action "skip_if_first_fails" "std::send_http_instruction" {
    url = "https://example.com"
    pre_condition {
         behavior = "skip"
         assertion = std::assert_eq(action.get_endpoint.status_code, 200)
    }
}

action "dont_skip_if_first_fails" "std::send_http_instruction" {
    url = "https://example.com"
}

Full documentation for this new feature can be found at https://docs.txtx.run

What's Changed

  • fix(svm): allow processing instructions with raw instruction data by @daog1 in #295
  • fix: improve command descriptions for clarity by @neutiyoo in #291
  • fix(svm-core): reduce reduncant RPC calls; include commitment on transaction sends by @MicaiahReid in #293
  • feat(core/kit): introduce action pre & post conditions by @MicaiahReid in #298

New Contributors

Full Changelog: v0.2.19...v0.3.0

v0.2.19

04 Jun 17:05

Choose a tag to compare

What's Changed

  • fix(evm): don't prevent transaction execution on failed simulation by @MicaiahReid in #294

Full Changelog: v0.2.18...v0.2.19