Add Non interactive fee bumping example#109
Conversation
b7a0f5a to
8231b95
Compare
|
In 8231b95: trailing whitespace on several lines. |
|
In 8231b95: Looks like you're using Your changes to the test environment seem fine to me. |
|
Done reviewing 16ebe74 |
Had to refactor some of the dummy_env stuff. If I try to include change output in the default env, everything breaks and I did not want to spend time trying to fix all of tests. Instead, we create a new default with fee just for this one test case.
16ebe74 to
ab42d67
Compare
Can I do it. The casting table requires me to construct a tuple (u1, u1) to cast to u2. So I will need 6 of them to cast to u64? |
|
cc @uncomputable can you provide some guidance here? It doesn't seem right that the user has to call a jet explicitly for integer promotion. |
|
|
|
||
| // Helper function to ensure the provided boolean value is not negative. | ||
| fn check_neg(v : bool) { | ||
| assert!(jet::eq_8(jet::left_pad_low_1_8(<bool>::into(v)), 0)); |
There was a problem hiding this comment.
f2ccc62: <u1>::into(jet::complement_1(<bool>::into(v))) should be shorter to write and cheaper in fees. The casting <T>::into is free and doesn't appear in the Simplicity target code.
Simfony should have an in-built Boolean negation function.
| } | ||
|
|
||
| impl<'a, A: Clone> BTreeSlice<'a, A> { | ||
| impl<A: Clone> BTreeSlice<'_, A> { |
There was a problem hiding this comment.
ab42d67: Are you using rust analyzer? clippy didn't show me these lints. I can integrate a better linker than clippy into my workflow if there is one.
There was a problem hiding this comment.
@uncomputable I think that these lints showed up in a fairly recent version of nightly (maybe stable now?) and you just need to update your toolchain to see them.
|
Casting is possible when two Simfony types are based on the same Simplicity type. Casting is a NOP in terms of Simplicity. Integers with different bit width are different types in Simplicity, so there is no cast. To convert |
uncomputable
left a comment
There was a problem hiding this comment.
ACK ab42d67 Feel free to optimize the check_neg function.
|
I have code to dynamically generate witness data for most of the Simfony examples, so we can change the Elements environment without every test failing. I will make a PR when the API is ready and integrate the hotfix from this PR. |
|
I am planning to post this example on delving bitcoin to get some more attention to simphony and some cool applications. Let me know if you have any objections |
|
That's a great idea. Make sure you hit the right spelling :) |
Had to refactor some of the dummy_env stuff.
If I try to include change output in the default env, everything breaks and I did not want to spend time trying to fix all of tests. Instead, we create a new default with fee just for this one test case.