fix: remove check from machine attestation request (#264)

`k.isNFTCreationRequest(msg.Machine)` was removed as it became obsolete
and we are not issuing generic tokens from within the machine
attestation process.

Closes #242

Signed-off-by: Julian Strobl <jmastr@mailbox.org>
This commit is contained in:
Julian Strobl 2024-01-09 10:25:50 +01:00 committed by GitHub
parent 6d05f85cbd
commit 25649be550
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,12 +24,6 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
func (k msgServer) isNFTCreationRequest(machine *types.Machine) bool {
if !machine.GetReissue() && machine.GetAmount() == 1 && machine.GetPrecision() == 8 {
return true
}
return false
}
func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMachine) (*types.MsgAttestMachineResponse, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
@ -55,7 +49,7 @@ func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMach
return nil, types.ErrMachineTypeUndefined
}
if k.isNFTCreationRequest(msg.Machine) && util.IsValidatorBlockProposer(ctx, ctx.BlockHeader().ProposerAddress) {
if util.IsValidatorBlockProposer(ctx, ctx.BlockHeader().ProposerAddress) {
util.GetAppLogger().Info(ctx, "Issuing Machine NFT: "+msg.Machine.String())
err := k.issueMachineNFT(goCtx, msg.Machine)
if err != nil {
@ -64,7 +58,7 @@ func (k msgServer) AttestMachine(goCtx context.Context, msg *types.MsgAttestMach
util.GetAppLogger().Info(ctx, "Machine NFT issuance successful: "+msg.Machine.String())
}
} else {
util.GetAppLogger().Info(ctx, "skipping Machine NFT issuance")
util.GetAppLogger().Info(ctx, "Not block proposer: skipping Machine NFT issuance")
}
k.StoreMachine(ctx, *msg.Machine)