File tree Expand file tree Collapse file tree 3 files changed +28
-9
lines changed
Expand file tree Collapse file tree 3 files changed +28
-9
lines changed Original file line number Diff line number Diff line change 7777 cd ledger
7878 cargo test --release -- -Z unstable-options --report-time
7979
80+ vrf-tests :
81+ runs-on : ubuntu-20.04
82+ steps :
83+ - name : Git checkout
84+ uses : actions/checkout@v4
85+ - name : Setup build dependencies
86+ run : |
87+ sudo apt update
88+ sudo apt install -y protobuf-compiler
89+ - name : Setup Rust
90+ run : |
91+ # Nightly to be able to use `--report-time` below
92+ rustup install nightly
93+ rustup override set nightly
94+ - name : Build vrf tests
95+ run : |
96+ cd vrf
97+ cargo build --release --tests
98+ - name : Run vrf tests
99+ run : |
100+ cd vrf
101+ cargo test --release -- -Z unstable-options --report-time
102+
80103 tx-fuzzer-check :
81104 runs-on : ubuntu-20.04
82105 steps :
Original file line number Diff line number Diff line change 11use ark_ff:: { One , SquareRootField , Zero } ;
22
3- use ledger:: ToInputs ;
3+ use ledger:: { proofs :: transaction :: legacy_input :: to_bits , ToInputs } ;
44use mina_curves:: pasta:: curves:: pallas:: Pallas as CurvePoint ;
55use mina_p2p_messages:: v2:: EpochSeed ;
66use o1_utils:: FieldHelpers ;
@@ -98,13 +98,9 @@ impl ToInputs for VrfMessage {
9898 }
9999 } ;
100100 inputs. append_field ( epoch_seed) ;
101- for i in ( 0 ..LEDGER_DEPTH ) . rev ( ) {
102- if self . delegator_index >> i & 1u64 == 1 {
103- inputs. append_bool ( true ) ;
104- } else {
105- inputs. append_bool ( false ) ;
106- }
107- }
108101 inputs. append_u32 ( self . global_slot ) ;
102+ for bit in to_bits :: < _ , LEDGER_DEPTH > ( self . delegator_index ) {
103+ inputs. append_bool ( bit) ;
104+ }
109105 }
110106}
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ mod test {
157157 let converted = ConsensusVrfOutputTruncatedStableV1 :: from ( vrf_output) ;
158158 let converted_string = serde_json:: to_string_pretty ( & converted) . unwrap ( ) ;
159159 let converted_string_deser: String = serde_json:: from_str ( & converted_string) . unwrap ( ) ;
160- let expected = String :: from ( "48H9Qk4D6RzS9kAJQX9HCDjiJ5qLiopxgxaS6xbDCWNaKQMQ9Y4C " ) ;
160+ let expected = String :: from ( "39cyg4ZmMtnb_aFUIerNAoAJV8qtkfOpq0zFzPspjgM= " ) ;
161161
162162 assert_eq ! ( expected, converted_string_deser) ;
163163 }
You can’t perform that action at this time.
0 commit comments