thenewboston-blockchain / Bank

Bank for thenewboston digital currency.
https://thenewboston.com
MIT License
87 stars 42 forks source link

Tx recipients must be unique #103

Closed vosi closed 3 years ago

vosi commented 3 years ago

Bug Description I'm running a separate dev network, and I get an error when trying to send coins between non-root accounts

Steps to Reproduce Steps to reproduce the behavior: Send coins between non-root accounts I believe the reason is that I have the same account for bank and validator fees

Screenshots/Recordings Payload

{
"account_number":"b00e8a5841f366e7b823b210d48114896ee1e9fa2d963937f31c712f1a4fe4c3",
"message":{
"balance_key":"b00e8a5841f366e7b823b210d48114896ee1e9fa2d963937f31c712f1a4fe4c3","txs":[
{"amount":1,"recipient":"7ac95e3083c35a8fe395b55a154cc61c89416d994a7109800b781b00aa1de2da"},
{"amount":1,"recipient":"7ac95e3083c35a8fe395b55a154cc61c89416d994a7109800b781b00aa1de2da"},
{"amount":55,"recipient":"ab2eb64eed61897a92bad08472126aff8ef9d52eae7f6f2dbf305fe34e3e97d3"}]
},
"signature":"0767703cfb2273aa99fd974a767158a10bb110f1345c44cf49278b3ee1dc65de78514bf24bbba597d12ebf327852c814f207ad439217d84c871e110cf4b49707"}

Error

{"non_field_errors":["Tx recipients must be unique"]}
DucPhamTV commented 3 years ago

:thinking: I thought the error is expected behavior, there are some tests similar to test_blocks_post_400_unique_recipients

buckyroberts commented 3 years ago
{"amount":1,"recipient":"7ac95e3083c35a8fe395b55a154cc61c89416d994a7109800b781b00aa1de2da"},
{"amount":1,"recipient":"7ac95e3083c35a8fe395b55a154cc61c89416d994a7109800b781b00aa1de2da"},

should be formatted as

{"amount":2,"recipient":"7ac95e3083c35a8fe395b55a154cc61c89416d994a7109800b781b00aa1de2da"},