Skip to content

Commit

Permalink
fix: update interfaces methods
Browse files Browse the repository at this point in the history
  • Loading branch information
whalelephant committed Aug 10, 2021
1 parent c8fec27 commit 8149a8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 6 additions & 1 deletion contracts/MultiSigFlowToken.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ pub contract MultiSigFlowToken: FungibleToken {

// Vault
//
pub resource Vault: FungibleToken.Provider, FungibleToken.Receiver, FungibleToken.Balance, OnChainMultiSig.PublicSigner {
pub resource Vault:
FungibleToken.Provider,
FungibleToken.Receiver,
FungibleToken.Balance,
OnChainMultiSig.PublicSigner,
OnChainMultiSig.PrivateKeyManager {

// holds the balance of a users tokens
pub var balance: UFix64
Expand Down
12 changes: 9 additions & 3 deletions contracts/OnChainMultiSig.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,26 @@ pub contract OnChainMultiSig {
}

pub resource interface PublicSigner {
// the first [UInt8] in the signable data will be the method
// follow by the args if args are not resources
pub fun UUID(): UInt64;
pub var signatureStore: SignatureStore;
pub fun addNewPayload(payload: PayloadDetails, publicKey: String, sig: [UInt8]);
pub fun addPayloadSignature (txIndex: UInt64, publicKey: String, sig: [UInt8]);
pub fun executeTx(txIndex: UInt64): @AnyResource?;
pub fun UUID(): UInt64;
}

pub resource interface PrivateKeyManager {
pub fun addKeys( multiSigPubKeys: [String], multiSigKeyWeights: [UFix64]);
pub fun removeKeys( multiSigPubKeys: [String]);
}

pub struct interface SignatureManager {
pub fun getSignableData(payload: PayloadDetails): [UInt8];
pub fun addNewPayload (resourceId: UInt64, payload: PayloadDetails, publicKey: String, sig: [UInt8]): SignatureStore;
pub fun addPayloadSignature (resourceId: UInt64, txIndex: UInt64, publicKey: String, sig: [UInt8]): SignatureStore;
pub fun readyForExecution(txIndex: UInt64): ExecutionDetails?;
pub fun configureKeys (pks: [String], kws: [UFix64]): SignatureStore;
pub fun removeKeys (pks: [String]): SignatureStore;
pub fun verifySigners (payload: PayloadDetails?, txIndex: UInt64?, pks: [String], sigs: [Crypto.KeyListSignature]): UFix64?;
}

pub struct SignatureStore {
Expand Down

0 comments on commit 8149a8c

Please sign in to comment.