mirror of
https://github.com/planetmint/planetmint-go.git
synced 2025-06-14 10:06:38 +00:00
add error handling to reissueMachineNFT
Signed-off-by: Lorenz Herzberger <lorenzherzberger@gmail.com>
This commit is contained in:
parent
722eb60bcf
commit
a63f390490
@ -22,7 +22,10 @@ func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMach
|
|||||||
}
|
}
|
||||||
|
|
||||||
if msg.Machine.Reissue {
|
if msg.Machine.Reissue {
|
||||||
k.reissueMachineNFT(msg.Machine)
|
err := k.reissueMachineNFT(msg.Machine)
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New("an error occured while reissuning the machine")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
k.StoreMachine(ctx, *msg.Machine)
|
k.StoreMachine(ctx, *msg.Machine)
|
||||||
@ -40,7 +43,7 @@ func validateIssuerLiquid(issuerLiquid string) bool {
|
|||||||
return isValidLiquidKey
|
return isValidLiquidKey
|
||||||
}
|
}
|
||||||
|
|
||||||
func (k msgServer) reissueMachineNFT(machine *types.Machine) {
|
func (k msgServer) reissueMachineNFT(machine *types.Machine) error {
|
||||||
client := osc.NewClient("localhost", 8765)
|
client := osc.NewClient("localhost", 8765)
|
||||||
msg := osc.NewMessage("/rddl/*")
|
msg := osc.NewMessage("/rddl/*")
|
||||||
msg.Append(machine.Name)
|
msg.Append(machine.Name)
|
||||||
@ -49,5 +52,6 @@ func (k msgServer) reissueMachineNFT(machine *types.Machine) {
|
|||||||
msg.Append(machine.Amount)
|
msg.Append(machine.Amount)
|
||||||
msg.Append("1")
|
msg.Append("1")
|
||||||
msg.Append(machine.Precision)
|
msg.Append(machine.Precision)
|
||||||
client.Send(msg)
|
err := client.Send(msg)
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user