Skip to content

Commit

Permalink
Merge pull request #274 from xian-network/devnet
Browse files Browse the repository at this point in the history
fix test and rewards contract not zero
  • Loading branch information
crosschainer authored Sep 11, 2024
2 parents c8c1892 + e8785dd commit e57172c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/xian/tools/genesis/contracts/rewards.s.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ def current_value():
def set_value(new_value: list):
assert len(new_value) == 4, 'New value must be a list of 4 elements'
assert sum(new_value) == 1, 'Sum of new value must be 1'
assert all([x > 0 for x in new_value]), 'There must be no 0 values in the list'
S['value'] = new_value
2 changes: 1 addition & 1 deletion tests/test_finalize_block.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def test_finalize_block(self):
request = Request(finalize_block=RequestFinalizeBlock(txs=[b"7b226d65746164617461223a7b227369676e6174757265223a226662333466663762383465623535386464366438623265343330323662326265646565363935346665353631616436326336636164346164373366323866313466323832643565366561663966663062343165613865643731346662313832626263346463383161636563356566626331363462343064326131393835373039227d2c227061796c6f6164223a7b22636861696e5f6964223a227869616e2d746573746e65742d31222c22636f6e7472616374223a227375626d697373696f6e222c2266756e6374696f6e223a227375626d69745f636f6e7472616374222c226b7761726773223a7b22636f6465223a225c6e23204c53543030315c6e62616c616e636573203d20486173682864656661756c745f76616c75653d30295c6e5c6e23204c53543030325c6e6d65746164617461203d204861736828295c6e5c6e40636f6e7374727563745c6e646566207365656428293a5c6e2020202023204c5354303031202d204d494e5420535550504c5920746f2077616c6c65742074686174207375626d6974732074686520636f6e74726163745c6e2020202062616c616e6365735b6374782e63616c6c65725d203d20315f3030305f3030305c6e5c6e2020202023204c53543030325c6e202020206d657461646174615b27746f6b656e5f6e616d65275d203d205c22526f636b657473776170205465737420546f6b656e5c225c6e202020206d657461646174615b27746f6b656e5f73796d626f6c275d203d205c22525357505c225c6e2020202023206d657461646174615b27746f6b656e5f6c6f676f5f75726c275d203d202768747470733a2f2f736f6d652e746f6b656e2e75726c2f746573742d746f6b656e2e706e67275c6e202020206d657461646174615b276f70657261746f72275d203d206374782e63616c6c65725c6e5c6e23204c53543030325c6e406578706f72745c6e646566206368616e67655f6d65746164617461286b65793a207374722c2076616c75653a20416e79293a5c6e20202020617373657274206374782e63616c6c6572203d3d206d657461646174615b276f70657261746f72275d2c20274f6e6c79206f70657261746f722063616e20736574206d6574616461746121275c6e202020206d657461646174615b6b65795d203d2076616c75655c6e5c6e23204c53543030315c6e406578706f72745c6e646566207472616e7366657228616d6f756e743a20666c6f61742c20746f3a20737472293a5c6e2020202061737365727420616d6f756e74203e20302c202743616e6e6f742073656e64206e656761746976652062616c616e63657321275c6e202020206173736572742062616c616e6365735b6374782e63616c6c65725d203e3d20616d6f756e742c20274e6f7420656e6f75676820636f696e7320746f2073656e6421275c6e5c6e2020202062616c616e6365735b6374782e63616c6c65725d202d3d20616d6f756e745c6e2020202062616c616e6365735b746f5d202b3d20616d6f756e745c6e5c6e23204c53543030315c6e406578706f72745c6e64656620617070726f766528616d6f756e743a20666c6f61742c20746f3a20737472293a5c6e2020202061737365727420616d6f756e74203e20302c202743616e6e6f742073656e64206e656761746976652062616c616e63657321275c6e2020202062616c616e6365735b6374782e63616c6c65722c20746f5d202b3d20616d6f756e745c6e5c6e23204c53543030315c6e406578706f72745c6e646566207472616e736665725f66726f6d28616d6f756e743a20666c6f61742c20746f3a207374722c206d61696e5f6163636f756e743a20737472293a5c6e2020202061737365727420616d6f756e74203e20302c202743616e6e6f742073656e64206e656761746976652062616c616e63657321275c6e202020206173736572742062616c616e6365735b6d61696e5f6163636f756e742c206374782e63616c6c65725d203e3d20616d6f756e742c20274e6f7420656e6f75676820636f696e7320617070726f76656420746f2073656e642120596f752068617665207b7d20616e642061726520747279696e6720746f207370656e64207b7d2720202020202020202e666f726d61742862616c616e6365735b6d61696e5f6163636f756e742c206374782e63616c6c65725d2c20616d6f756e74295c6e202020206173736572742062616c616e6365735b6d61696e5f6163636f756e745d203e3d20616d6f756e742c20274e6f7420656e6f75676820636f696e7320746f2073656e6421275c6e5c6e2020202062616c616e6365735b6d61696e5f6163636f756e742c206374782e63616c6c65725d202d3d20616d6f756e745c6e2020202062616c616e6365735b6d61696e5f6163636f756e745d202d3d20616d6f756e745c6e2020202062616c616e6365735b746f5d202b3d20616d6f756e745c6e222c226e616d65223a22636f6e5f74657374696e675f7375626d697373696f6e5f3836343932393539227d2c226e6f6e6365223a362c2273656e646572223a2265396538616164323963653865393466643737643963353535383265356530633537636638316335353262613631633064346533346230646331316664393331222c227374616d70735f737570706c696564223a35303030307d7d"]))
response = await self.process_request("finalize_block", request)
self.assertEqual(response.finalize_block.tx_results[0].code, c.ErrorCode)
self.assertEqual(response.finalize_block.app_hash, b'7502b3786541cd636ed5d3c01c395bfbac68fd466387ecd956059eee0f2d86e9')
self.assertEqual(response.finalize_block.app_hash, b'dc334182760f5c8fb1ce9bfdf6f8b585b2fa2d95e9aa6b2af60e5bdb19c40161')

if __name__ == "__main__":
unittest.main()

0 comments on commit e57172c

Please sign in to comment.