-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,895 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
syntax = "proto3"; | ||
|
||
package sourcehub.acp; | ||
|
||
import "amino/amino.proto"; | ||
import "cosmos/msg/v1/msg.proto"; | ||
import "cosmos_proto/cosmos.proto"; | ||
import "gogoproto/gogo.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
import "sourcehub/acp/access_decision.proto"; | ||
import "sourcehub/acp/time.proto"; | ||
import "sourcenetwork/acp_core/policy_short.proto"; | ||
import "sourcenetwork/acp_core/policy.proto"; | ||
import "sourcenetwork/acp_core/relationship.proto"; | ||
|
||
option go_package = "github.com/sourcenetwork/sourcehub/x/acp/types"; | ||
|
||
message RecordMetadata { | ||
Timestamp creation_ts = 1; | ||
bytes tx_hash = 2; | ||
string tx_signer = 3; | ||
string owner = 4; | ||
} | ||
|
||
message PolicyRecord { | ||
sourcenetwork.acp_core.Policy policy = 1; | ||
RecordMetadata metadata = 2; | ||
string raw_policy = 3; | ||
// marshal_type flags the format of policy_raw | ||
sourcenetwork.acp_core.PolicyMarshalingType marshal_type = 4; | ||
} | ||
|
||
message RelationshipRecord { | ||
sourcenetwork.acp_core.Relationship relationship = 1; | ||
RecordMetadata metadata = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package keeper | ||
|
||
import ( | ||
"context" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
prototypes "github.com/cosmos/gogoproto/types" | ||
"github.com/sourcenetwork/acp_core/pkg/runtime" | ||
) | ||
|
||
var _ runtime.TimeService = (*SourcehubTimeProvider)(nil) | ||
|
||
type SourcehubTimeProvider struct{} | ||
|
||
func (p *SourcehubTimeProvider) GetNow(goCtx context.Context) (*prototypes.Timestamp, error) { | ||
ctx := sdk.UnwrapSDKContext(goCtx) | ||
time := ctx.BlockTime() | ||
ts, err := prototypes.TimestampProto(time) | ||
if err != nil { | ||
return nil, err | ||
} | ||
return ts, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.