accountant: minor cleanup

This commit is contained in:
Conor Patrick 2023-02-15 15:10:40 +00:00 committed by Evan Gray
parent b1525333eb
commit bbec427145
3 changed files with 5 additions and 8 deletions

View File

@ -146,7 +146,7 @@ func tokenBridgeRegisterChain(req *nodev1.BridgeRegisterChain, timestamp time.Ti
return v, nil
}
// tokenBridgeUpgradeContract converts a nodev1.TokenBridgeRegisterChain message to its canonical VAA representation.
// tokenBridgeModifyBalance converts a nodev1.TokenBridgeModifyBalance message to its canonical VAA representation.
// Returns an error if the data is invalid.
func tokenBridgeModifyBalance(req *nodev1.BridgeModifyBalance, timestamp time.Time, guardianSetIndex uint32, nonce uint32, sequence uint64) (*vaa.VAA, error) {
if req.TargetChainId > math.MaxUint16 {

View File

@ -493,7 +493,7 @@ mod governance_packet_impl {
}
v => {
return Err(Error::custom(format_args!(
"invalid value: {v}, expected one of 1, 2"
"invalid value: {v}, expected one of 1, 2, 3"
)))
}
};

View File

@ -149,12 +149,9 @@ func (r BodyTokenBridgeModifyBalance) Serialize() []byte {
reason := make([]byte, 32)
// truncate or pad "reason"
for i := 0; i < len(reason); i += 1 {
if i < len(r.Reason) {
reason[i] = r.Reason[i]
} else {
reason[i] = ' '
}
count := copy(reason, r.Reason)
for i := range reason[count:] {
reason[i] = ' '
}
payload.Write(reason)